拷贝晟华新大屏
24
.babelrc
Normal file
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"presets": [
|
||||
["es2015", { "modules": false }],
|
||||
[
|
||||
"env", {
|
||||
"modules": false,
|
||||
"targets": {
|
||||
"browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
|
||||
}
|
||||
}],
|
||||
"stage-2"
|
||||
],
|
||||
"plugins": [
|
||||
"transform-vue-jsx",
|
||||
"transform-runtime",
|
||||
[
|
||||
"component",
|
||||
{
|
||||
"libraryName": "element-ui",
|
||||
"styleLibraryName": "theme-chalk"
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
9
.editorconfig
Normal file
@@ -0,0 +1,9 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
4
.eslintignore
Normal file
@@ -0,0 +1,4 @@
|
||||
/build/
|
||||
/config/
|
||||
/dist/
|
||||
/*.js
|
||||
29
.eslintrc.js
Normal file
@@ -0,0 +1,29 @@
|
||||
// https://eslint.org/docs/user-guide/configuring
|
||||
|
||||
module.exports = {
|
||||
root: true,
|
||||
parserOptions: {
|
||||
parser: 'babel-eslint'
|
||||
},
|
||||
env: {
|
||||
browser: true,
|
||||
},
|
||||
extends: [
|
||||
// https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention
|
||||
// consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules.
|
||||
'plugin:vue/essential',
|
||||
// https://github.com/standard/standard/blob/master/docs/RULES-en.md
|
||||
'standard'
|
||||
],
|
||||
// required to lint *.vue files
|
||||
plugins: [
|
||||
'vue'
|
||||
],
|
||||
// add your custom rules here
|
||||
rules: {
|
||||
// allow async-await
|
||||
'generator-star-spacing': 'off',
|
||||
// allow debugger during development
|
||||
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
|
||||
}
|
||||
}
|
||||
14
.gitignore
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
.DS_Store
|
||||
node_modules/
|
||||
/dist/
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
|
||||
# Editor directories and files
|
||||
.idea
|
||||
.vscode
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
10
.postcssrc.js
Normal file
@@ -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": {}
|
||||
}
|
||||
}
|
||||
24
README.md
Normal file
@@ -0,0 +1,24 @@
|
||||
# nl-screen-hl
|
||||
|
||||
> A Vue.js project
|
||||
|
||||
## Build Setup
|
||||
|
||||
``` bash
|
||||
# install dependencies
|
||||
npm install
|
||||
|
||||
# serve with hot reload at localhost:8080
|
||||
npm run dev
|
||||
|
||||
# build for production with minification
|
||||
npm run build
|
||||
|
||||
# build for production and view the bundle analyzer report
|
||||
npm run build --report
|
||||
```
|
||||
|
||||
For a detailed explanation on how things work, check out the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader).
|
||||
|
||||
# 注意事项
|
||||
+ 华弘大屏分辨率都为 1920 * 1200
|
||||
41
build/build.js
Normal file
@@ -0,0 +1,41 @@
|
||||
'use strict'
|
||||
require('./check-versions')()
|
||||
|
||||
process.env.NODE_ENV = 'production'
|
||||
|
||||
const ora = require('ora')
|
||||
const rm = require('rimraf')
|
||||
const path = require('path')
|
||||
const chalk = require('chalk')
|
||||
const webpack = require('webpack')
|
||||
const config = require('../config')
|
||||
const webpackConfig = require('./webpack.prod.conf')
|
||||
|
||||
const spinner = ora('building for production...')
|
||||
spinner.start()
|
||||
|
||||
rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
|
||||
if (err) throw err
|
||||
webpack(webpackConfig, (err, stats) => {
|
||||
spinner.stop()
|
||||
if (err) throw err
|
||||
process.stdout.write(stats.toString({
|
||||
colors: true,
|
||||
modules: false,
|
||||
children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build.
|
||||
chunks: false,
|
||||
chunkModules: false
|
||||
}) + '\n\n')
|
||||
|
||||
if (stats.hasErrors()) {
|
||||
console.log(chalk.red(' Build failed with errors.\n'))
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
console.log(chalk.cyan(' Build complete.\n'))
|
||||
console.log(chalk.yellow(
|
||||
' Tip: built files are meant to be served over an HTTP server.\n' +
|
||||
' Opening index.html over file:// won\'t work.\n'
|
||||
))
|
||||
})
|
||||
})
|
||||
54
build/check-versions.js
Normal file
@@ -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)
|
||||
}
|
||||
}
|
||||
BIN
build/logo.png
Normal file
|
After Width: | Height: | Size: 6.7 KiB |
102
build/utils.js
Normal file
@@ -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,
|
||||
publicPath: '../../',
|
||||
fallback: 'vue-style-loader'
|
||||
})
|
||||
} else {
|
||||
return ['vue-style-loader'].concat(loaders)
|
||||
}
|
||||
}
|
||||
|
||||
// https://vue-loader.vuejs.org/en/configurations/extract-css.html
|
||||
return {
|
||||
css: generateLoaders(),
|
||||
postcss: generateLoaders(),
|
||||
less: generateLoaders('less'),
|
||||
sass: generateLoaders('sass', { indentedSyntax: true }),
|
||||
scss: generateLoaders('sass'),
|
||||
stylus: generateLoaders('stylus'),
|
||||
styl: generateLoaders('stylus')
|
||||
}
|
||||
}
|
||||
|
||||
// Generate loaders for standalone style files (outside of .vue)
|
||||
exports.styleLoaders = function (options) {
|
||||
const output = []
|
||||
const loaders = exports.cssLoaders(options)
|
||||
|
||||
for (const extension in loaders) {
|
||||
const loader = loaders[extension]
|
||||
output.push({
|
||||
test: new RegExp('\\.' + extension + '$'),
|
||||
use: loader
|
||||
})
|
||||
}
|
||||
|
||||
return output
|
||||
}
|
||||
|
||||
exports.createNotifierCallback = () => {
|
||||
const notifier = require('node-notifier')
|
||||
|
||||
return (severity, errors) => {
|
||||
if (severity !== 'error') return
|
||||
|
||||
const error = errors[0]
|
||||
const filename = error.file && error.file.split('!').pop()
|
||||
|
||||
notifier.notify({
|
||||
title: packageConfig.name,
|
||||
message: severity + ': ' + error.name,
|
||||
subtitle: filename || '',
|
||||
icon: path.join(__dirname, 'logo.png')
|
||||
})
|
||||
}
|
||||
}
|
||||
22
build/vue-loader.conf.js
Normal file
@@ -0,0 +1,22 @@
|
||||
'use strict'
|
||||
const utils = require('./utils')
|
||||
const config = require('../config')
|
||||
const isProduction = process.env.NODE_ENV === 'production'
|
||||
const sourceMapEnabled = isProduction
|
||||
? config.build.productionSourceMap
|
||||
: config.dev.cssSourceMap
|
||||
|
||||
module.exports = {
|
||||
loaders: utils.cssLoaders({
|
||||
sourceMap: sourceMapEnabled,
|
||||
extract: isProduction
|
||||
}),
|
||||
cssSourceMap: sourceMapEnabled,
|
||||
cacheBusting: config.dev.cacheBusting,
|
||||
transformToRequire: {
|
||||
video: ['src', 'poster'],
|
||||
source: 'src',
|
||||
img: 'src',
|
||||
image: 'xlink:href'
|
||||
}
|
||||
}
|
||||
106
build/webpack.base.conf.js
Normal file
@@ -0,0 +1,106 @@
|
||||
'use strict'
|
||||
const path = require('path')
|
||||
const utils = require('./utils')
|
||||
const config = require('../config')
|
||||
const vueLoaderConfig = require('./vue-loader.conf')
|
||||
const webpack = require("webpack")
|
||||
|
||||
function resolve (dir) {
|
||||
return path.join(__dirname, '..', dir)
|
||||
}
|
||||
|
||||
const createLintingRule = () => ({
|
||||
test: /\.(js|vue)$/,
|
||||
loader: 'eslint-loader',
|
||||
enforce: 'pre',
|
||||
include: [resolve('src'), resolve('test')],
|
||||
options: {
|
||||
formatter: require('eslint-friendly-formatter'),
|
||||
emitWarning: !config.dev.showEslintErrorsInOverlay
|
||||
}
|
||||
})
|
||||
|
||||
module.exports = {
|
||||
context: path.resolve(__dirname, '../'),
|
||||
entry: {
|
||||
app: './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'),
|
||||
'@components': resolve('src') + '/components',
|
||||
'@page': resolve('src') + '/pages',
|
||||
'@style': resolve('src') + '/style',
|
||||
'@img': resolve('src') + '/images',
|
||||
'@js': resolve('src') + '/config'
|
||||
}
|
||||
},
|
||||
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'
|
||||
},
|
||||
// add jquery peizhi
|
||||
plugins: [
|
||||
new webpack.optimize.CommonsChunkPlugin('common.js'),
|
||||
new webpack.ProvidePlugin({
|
||||
jQuery: "jquery",
|
||||
$: "jquery"
|
||||
})
|
||||
]
|
||||
}
|
||||
95
build/webpack.dev.conf.js
Normal file
@@ -0,0 +1,95 @@
|
||||
'use strict'
|
||||
const utils = require('./utils')
|
||||
const webpack = require('webpack')
|
||||
const config = require('../config')
|
||||
const merge = require('webpack-merge')
|
||||
const path = require('path')
|
||||
const baseWebpackConfig = require('./webpack.base.conf')
|
||||
const CopyWebpackPlugin = require('copy-webpack-plugin')
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin')
|
||||
const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
|
||||
const portfinder = require('portfinder')
|
||||
|
||||
const HOST = process.env.HOST
|
||||
const PORT = process.env.PORT && Number(process.env.PORT)
|
||||
|
||||
const devWebpackConfig = merge(baseWebpackConfig, {
|
||||
module: {
|
||||
rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true })
|
||||
},
|
||||
// cheap-module-eval-source-map is faster for development
|
||||
devtool: config.dev.devtool,
|
||||
|
||||
// these devServer options should be customized in /config/index.js
|
||||
devServer: {
|
||||
clientLogLevel: 'warning',
|
||||
historyApiFallback: {
|
||||
rewrites: [
|
||||
{ from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') },
|
||||
],
|
||||
},
|
||||
hot: true,
|
||||
contentBase: false, // since we use CopyWebpackPlugin.
|
||||
compress: true,
|
||||
host: HOST || config.dev.host,
|
||||
port: PORT || config.dev.port,
|
||||
open: config.dev.autoOpenBrowser,
|
||||
overlay: config.dev.errorOverlay
|
||||
? { warnings: false, errors: true }
|
||||
: false,
|
||||
publicPath: config.dev.assetsPublicPath,
|
||||
proxy: config.dev.proxyTable,
|
||||
quiet: true, // necessary for FriendlyErrorsPlugin
|
||||
watchOptions: {
|
||||
poll: config.dev.poll,
|
||||
}
|
||||
},
|
||||
plugins: [
|
||||
new webpack.DefinePlugin({
|
||||
'process.env': require('../config/dev.env')
|
||||
}),
|
||||
new webpack.HotModuleReplacementPlugin(),
|
||||
new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update.
|
||||
new webpack.NoEmitOnErrorsPlugin(),
|
||||
// https://github.com/ampedandwired/html-webpack-plugin
|
||||
new HtmlWebpackPlugin({
|
||||
filename: 'index.html',
|
||||
template: 'index.html',
|
||||
inject: true
|
||||
}),
|
||||
// copy custom static assets
|
||||
new CopyWebpackPlugin([
|
||||
{
|
||||
from: path.resolve(__dirname, '../static'),
|
||||
to: config.dev.assetsSubDirectory,
|
||||
ignore: ['.*']
|
||||
}
|
||||
])
|
||||
]
|
||||
})
|
||||
|
||||
module.exports = new Promise((resolve, reject) => {
|
||||
portfinder.basePort = process.env.PORT || config.dev.port
|
||||
portfinder.getPort((err, port) => {
|
||||
if (err) {
|
||||
reject(err)
|
||||
} else {
|
||||
// publish the new Port, necessary for e2e tests
|
||||
process.env.PORT = port
|
||||
// add port to devServer config
|
||||
devWebpackConfig.devServer.port = port
|
||||
|
||||
// Add FriendlyErrorsPlugin
|
||||
devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({
|
||||
compilationSuccessInfo: {
|
||||
messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`],
|
||||
},
|
||||
onErrors: config.dev.notifyOnErrors
|
||||
? utils.createNotifierCallback()
|
||||
: undefined
|
||||
}))
|
||||
|
||||
resolve(devWebpackConfig)
|
||||
}
|
||||
})
|
||||
})
|
||||
145
build/webpack.prod.conf.js
Normal file
@@ -0,0 +1,145 @@
|
||||
'use strict'
|
||||
const path = require('path')
|
||||
const utils = require('./utils')
|
||||
const webpack = require('webpack')
|
||||
const config = require('../config')
|
||||
const merge = require('webpack-merge')
|
||||
const baseWebpackConfig = require('./webpack.base.conf')
|
||||
const CopyWebpackPlugin = require('copy-webpack-plugin')
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin')
|
||||
const ExtractTextPlugin = require('extract-text-webpack-plugin')
|
||||
const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin')
|
||||
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
|
||||
|
||||
const env = require('../config/prod.env')
|
||||
|
||||
const webpackConfig = merge(baseWebpackConfig, {
|
||||
module: {
|
||||
rules: utils.styleLoaders({
|
||||
sourceMap: config.build.productionSourceMap,
|
||||
extract: true,
|
||||
usePostCSS: true
|
||||
})
|
||||
},
|
||||
devtool: config.build.productionSourceMap ? config.build.devtool : false,
|
||||
output: {
|
||||
path: config.build.assetsRoot,
|
||||
filename: utils.assetsPath('js/[name].[chunkhash].js'),
|
||||
chunkFilename: utils.assetsPath('js/[id].[chunkhash].js')
|
||||
},
|
||||
plugins: [
|
||||
// http://vuejs.github.io/vue-loader/en/workflow/production.html
|
||||
new webpack.DefinePlugin({
|
||||
'process.env': env
|
||||
}),
|
||||
new UglifyJsPlugin({
|
||||
uglifyOptions: {
|
||||
compress: {
|
||||
warnings: false
|
||||
}
|
||||
},
|
||||
sourceMap: config.build.productionSourceMap,
|
||||
parallel: true
|
||||
}),
|
||||
// extract css into its own file
|
||||
new ExtractTextPlugin({
|
||||
filename: utils.assetsPath('css/[name].[contenthash].css'),
|
||||
// Setting the following option to `false` will not extract CSS from codesplit chunks.
|
||||
// Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack.
|
||||
// It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`,
|
||||
// increasing file size: https://github.com/vuejs-templates/webpack/issues/1110
|
||||
allChunks: true,
|
||||
}),
|
||||
// Compress extracted CSS. We are using this plugin so that possible
|
||||
// duplicated CSS from different components can be deduped.
|
||||
new OptimizeCSSPlugin({
|
||||
cssProcessorOptions: config.build.productionSourceMap
|
||||
? { safe: true, map: { inline: false } }
|
||||
: { safe: true }
|
||||
}),
|
||||
// generate dist index.html with correct asset hash for caching.
|
||||
// you can customize output by editing /index.html
|
||||
// see https://github.com/ampedandwired/html-webpack-plugin
|
||||
new HtmlWebpackPlugin({
|
||||
filename: config.build.index,
|
||||
template: 'index.html',
|
||||
inject: true,
|
||||
minify: {
|
||||
removeComments: true,
|
||||
collapseWhitespace: true,
|
||||
removeAttributeQuotes: true
|
||||
// more options:
|
||||
// https://github.com/kangax/html-minifier#options-quick-reference
|
||||
},
|
||||
// necessary to consistently work with multiple chunks via CommonsChunkPlugin
|
||||
chunksSortMode: 'dependency'
|
||||
}),
|
||||
// keep module.id stable when vendor modules does not change
|
||||
new webpack.HashedModuleIdsPlugin(),
|
||||
// enable scope hoisting
|
||||
new webpack.optimize.ModuleConcatenationPlugin(),
|
||||
// split vendor js into its own file
|
||||
new webpack.optimize.CommonsChunkPlugin({
|
||||
name: 'vendor',
|
||||
minChunks (module) {
|
||||
// any required modules inside node_modules are extracted to vendor
|
||||
return (
|
||||
module.resource &&
|
||||
/\.js$/.test(module.resource) &&
|
||||
module.resource.indexOf(
|
||||
path.join(__dirname, '../node_modules')
|
||||
) === 0
|
||||
)
|
||||
}
|
||||
}),
|
||||
// extract webpack runtime and module manifest to its own file in order to
|
||||
// prevent vendor hash from being updated whenever app bundle is updated
|
||||
new webpack.optimize.CommonsChunkPlugin({
|
||||
name: 'manifest',
|
||||
minChunks: Infinity
|
||||
}),
|
||||
// This instance extracts shared chunks from code splitted chunks and bundles them
|
||||
// in a separate chunk, similar to the vendor chunk
|
||||
// see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk
|
||||
new webpack.optimize.CommonsChunkPlugin({
|
||||
name: 'app',
|
||||
async: 'vendor-async',
|
||||
children: true,
|
||||
minChunks: 3
|
||||
}),
|
||||
|
||||
// copy custom static assets
|
||||
new CopyWebpackPlugin([
|
||||
{
|
||||
from: path.resolve(__dirname, '../static'),
|
||||
to: config.build.assetsSubDirectory,
|
||||
ignore: ['.*']
|
||||
}
|
||||
])
|
||||
]
|
||||
})
|
||||
|
||||
if (config.build.productionGzip) {
|
||||
const CompressionWebpackPlugin = require('compression-webpack-plugin')
|
||||
|
||||
webpackConfig.plugins.push(
|
||||
new CompressionWebpackPlugin({
|
||||
asset: '[path].gz[query]',
|
||||
algorithm: 'gzip',
|
||||
test: new RegExp(
|
||||
'\\.(' +
|
||||
config.build.productionGzipExtensions.join('|') +
|
||||
')$'
|
||||
),
|
||||
threshold: 10240,
|
||||
minRatio: 0.8
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
if (config.build.bundleAnalyzerReport) {
|
||||
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
|
||||
webpackConfig.plugins.push(new BundleAnalyzerPlugin())
|
||||
}
|
||||
|
||||
module.exports = webpackConfig
|
||||
7
config/dev.env.js
Normal file
@@ -0,0 +1,7 @@
|
||||
'use strict'
|
||||
const merge = require('webpack-merge')
|
||||
const prodEnv = require('./prod.env')
|
||||
|
||||
module.exports = merge(prodEnv, {
|
||||
NODE_ENV: '"development"'
|
||||
})
|
||||
76
config/index.js
Normal file
@@ -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: '0.0.0.0', // 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: true,
|
||||
errorOverlay: true,
|
||||
notifyOnErrors: true,
|
||||
poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
|
||||
|
||||
// Use Eslint Loader?
|
||||
// If true, your code will be linted during bundling and
|
||||
// linting errors and warnings will be shown in the console.
|
||||
useEslint: true,
|
||||
// If true, eslint errors and warnings will also be shown in the error overlay
|
||||
// in the browser.
|
||||
showEslintErrorsInOverlay: false,
|
||||
|
||||
/**
|
||||
* Source Maps
|
||||
*/
|
||||
|
||||
// https://webpack.js.org/configuration/devtool/#development
|
||||
devtool: 'cheap-module-eval-source-map',
|
||||
|
||||
// If you have problems debugging vue-files in devtools,
|
||||
// set this to false - it *may* help
|
||||
// https://vue-loader.vuejs.org/en/options.html#cachebusting
|
||||
cacheBusting: true,
|
||||
|
||||
cssSourceMap: true
|
||||
},
|
||||
|
||||
build: {
|
||||
// Template for index.html
|
||||
index: path.resolve(__dirname, '../dist/index.html'),
|
||||
|
||||
// Paths
|
||||
assetsRoot: path.resolve(__dirname, '../dist'),
|
||||
assetsSubDirectory: 'static',
|
||||
assetsPublicPath: './',
|
||||
|
||||
/**
|
||||
* Source Maps
|
||||
*/
|
||||
|
||||
productionSourceMap: true,
|
||||
// https://webpack.js.org/configuration/devtool/#production
|
||||
devtool: '#source-map',
|
||||
|
||||
// Gzip off by default as many popular static hosts such as
|
||||
// Surge or Netlify already gzip all static assets for you.
|
||||
// Before setting to `true`, make sure to:
|
||||
// npm install --save-dev compression-webpack-plugin
|
||||
productionGzip: false,
|
||||
productionGzipExtensions: ['js', 'css'],
|
||||
|
||||
// Run the build command with an extra argument to
|
||||
// View the bundle analyzer report after build finishes:
|
||||
// `npm run build --report`
|
||||
// Set to `true` or `false` to always turn it on or off
|
||||
bundleAnalyzerReport: process.env.npm_config_report
|
||||
}
|
||||
}
|
||||
4
config/prod.env.js
Normal file
@@ -0,0 +1,4 @@
|
||||
'use strict'
|
||||
module.exports = {
|
||||
NODE_ENV: '"production"'
|
||||
}
|
||||
11
index.html
Normal file
@@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0, minimum-scale=1.0,user-scalable=no">
|
||||
<title>晟华大屏监控</title>
|
||||
</head>
|
||||
<body class="clearfix">
|
||||
<div id="app"></div>
|
||||
</body>
|
||||
</html>
|
||||
11958
package-lock.json
generated
Normal file
89
package.json
Normal file
@@ -0,0 +1,89 @@
|
||||
{
|
||||
"name": "screen-lnsh-new",
|
||||
"version": "1.0.0",
|
||||
"description": "A Vue.js project",
|
||||
"author": "cll",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
|
||||
"start": "npm run dev",
|
||||
"lint": "eslint --ext .js,.vue src",
|
||||
"build": "node build/build.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"add": "^2.0.6",
|
||||
"axios": "^0.18.0",
|
||||
"babel-plugin-component": "^1.1.1",
|
||||
"babel-polyfill": "^6.26.0",
|
||||
"babel-preset-es2015": "^6.24.1",
|
||||
"default-passive-events": "^2.0.0",
|
||||
"echarts": "^5.1.1",
|
||||
"element-ui": "^2.15.14",
|
||||
"stylus": "^0.54.5",
|
||||
"stylus-loader": "^3.0.2",
|
||||
"vue": "^2.5.2",
|
||||
"vue-particles": "^1.0.9",
|
||||
"vue-router": "^3.0.1",
|
||||
"vue-seamless-scroll": "^1.1.16",
|
||||
"vuex": "^3.0.1",
|
||||
"yarn": "^1.22.21"
|
||||
},
|
||||
"devDependencies": {
|
||||
"autoprefixer": "^7.1.2",
|
||||
"babel-core": "^6.22.1",
|
||||
"babel-eslint": "^8.2.1",
|
||||
"babel-helper-vue-jsx-merge-props": "^2.0.3",
|
||||
"babel-loader": "^7.1.1",
|
||||
"babel-plugin-import": "^1.9.1",
|
||||
"babel-plugin-syntax-jsx": "^6.18.0",
|
||||
"babel-plugin-transform-runtime": "^6.22.0",
|
||||
"babel-plugin-transform-vue-jsx": "^3.5.0",
|
||||
"babel-preset-env": "^1.3.2",
|
||||
"babel-preset-stage-2": "^6.22.0",
|
||||
"chalk": "^2.0.1",
|
||||
"copy-webpack-plugin": "^4.0.1",
|
||||
"css-loader": "^0.28.0",
|
||||
"eslint": "^4.15.0",
|
||||
"eslint-config-standard": "^10.2.1",
|
||||
"eslint-friendly-formatter": "^3.0.0",
|
||||
"eslint-loader": "^1.7.1",
|
||||
"eslint-plugin-import": "^2.7.0",
|
||||
"eslint-plugin-node": "^5.2.0",
|
||||
"eslint-plugin-promise": "^3.4.0",
|
||||
"eslint-plugin-standard": "^3.0.1",
|
||||
"eslint-plugin-vue": "^4.0.0",
|
||||
"extract-text-webpack-plugin": "^3.0.0",
|
||||
"file-loader": "^1.1.4",
|
||||
"friendly-errors-webpack-plugin": "^1.6.1",
|
||||
"html-webpack-plugin": "^2.30.1",
|
||||
"node-notifier": "^5.1.2",
|
||||
"optimize-css-assets-webpack-plugin": "^3.2.0",
|
||||
"ora": "^1.2.0",
|
||||
"portfinder": "^1.0.13",
|
||||
"postcss-import": "^11.0.0",
|
||||
"postcss-loader": "^2.0.8",
|
||||
"postcss-url": "^7.2.1",
|
||||
"rimraf": "^2.6.0",
|
||||
"semver": "^5.3.0",
|
||||
"shelljs": "^0.7.6",
|
||||
"uglifyjs-webpack-plugin": "^1.1.1",
|
||||
"url-loader": "^0.5.8",
|
||||
"vconsole": "^3.2.0",
|
||||
"vue-loader": "^13.3.0",
|
||||
"vue-style-loader": "^3.0.1",
|
||||
"vue-template-compiler": "^2.5.2",
|
||||
"webpack": "^3.6.0",
|
||||
"webpack-bundle-analyzer": "^2.9.0",
|
||||
"webpack-dev-server": "^2.9.1",
|
||||
"webpack-merge": "^4.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6.0.0",
|
||||
"npm": ">= 3.0.0"
|
||||
},
|
||||
"browserslist": [
|
||||
"> 1%",
|
||||
"last 2 versions",
|
||||
"not ie <= 8"
|
||||
]
|
||||
}
|
||||
20
src/App.vue
Normal file
@@ -0,0 +1,20 @@
|
||||
<template>
|
||||
<div id="app">
|
||||
<router-view/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'App',
|
||||
data () {
|
||||
return {}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
#app
|
||||
width 100%
|
||||
height 100%
|
||||
</style>
|
||||
75
src/components/header.vue
Normal file
@@ -0,0 +1,75 @@
|
||||
<template>
|
||||
<header>
|
||||
<div class="center_text">晟华大屏监控</div>
|
||||
<div class="tag_block">
|
||||
<div class="tag_left">
|
||||
<!-- <div v-if="index == '0'" class="tag cur_tag">首页</div>
|
||||
<router-link v-else to="/homepage" class="tag">首页</router-link> -->
|
||||
<div v-if="index == '1'" class="tag cur_tag">生产统计</div>
|
||||
<router-link v-else to="/prodcount" class="tag">生产统计</router-link>
|
||||
</div>
|
||||
<div class="tag_right">
|
||||
<div v-if="index == '2'" class="tag cur_tag">仓储监控</div>
|
||||
<router-link v-else to="/storagemonitor" class="tag">仓储监控</router-link>
|
||||
<div v-if="index == '3'" class="tag cur_tag">设备监控</div>
|
||||
<router-link v-else to="/devicemonitor" class="tag">设备监控</router-link>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'Header',
|
||||
data () {
|
||||
return {}
|
||||
},
|
||||
props: {
|
||||
index: String
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
@import '~@style/mixin'
|
||||
header
|
||||
_wh(100%, 84px)
|
||||
overflow hidden
|
||||
position relative
|
||||
_bis('../assets/images/top.png',auto, 84px)
|
||||
.center_text
|
||||
_wh(400px, 40px)
|
||||
position absolute
|
||||
_font(36px, 40px, #fff,,center)
|
||||
font-family "阿里妈妈数黑体" !important
|
||||
left 50%
|
||||
top 8px
|
||||
margin-left -200px
|
||||
letter-spacing 6px
|
||||
.tag_block
|
||||
_wh(100%, 100%)
|
||||
_fj(row)
|
||||
padding 25px 15px 0
|
||||
.tag_left
|
||||
_wh(50%, 100%)
|
||||
_fj(row, flex-start)
|
||||
.tag
|
||||
margin-right 20px
|
||||
.tag_right
|
||||
_wh(50%, 100%)
|
||||
_fj(row, flex-end)
|
||||
.tag
|
||||
margin-left 20px
|
||||
.tag
|
||||
display inline-block
|
||||
_wh(132px, 36px)
|
||||
_font(16px, 36px)
|
||||
_bis('../assets/images/tag_1.png')
|
||||
cursor pointer
|
||||
&:hover
|
||||
color #32C5FF
|
||||
_bis('../assets/images/tag_2.png')
|
||||
.cur_tag
|
||||
color #32C5FF
|
||||
_bis('../assets/images/tag_2.png')
|
||||
</style>
|
||||
97
src/components/select.vue
Normal file
@@ -0,0 +1,97 @@
|
||||
<template>
|
||||
<div class="select">
|
||||
<div class="select-item pointer" @click="selectOption">
|
||||
<div class="select-item-txt">{{defaultLabel}}</div>
|
||||
<div class="select-item-button"> </div>
|
||||
</div>
|
||||
<ul v-show="active" class="options">
|
||||
<li class="pointer" :class="{'li-active': e.index === index}" v-for="e in option" :key="e.index" @click="change(e)">{{e.label}}</li>
|
||||
</ul>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'SelectOpt',
|
||||
props: {
|
||||
option: Array,
|
||||
index: [Number, String]
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
active: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
defaultLabel () {
|
||||
let val = ''
|
||||
this.option.map(e => {
|
||||
if (e.index === this.index) {
|
||||
val = e.label
|
||||
}
|
||||
})
|
||||
return val
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
selectOption () {
|
||||
this.active = true
|
||||
},
|
||||
change (e) {
|
||||
this.$emit('change', e.index)
|
||||
this.active = false
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
@import '~@style/mixin'
|
||||
.select
|
||||
position relative
|
||||
_wh(100%, inherit)
|
||||
background-color #fff
|
||||
user-select none
|
||||
.select-item
|
||||
width 100%
|
||||
_fj(row)
|
||||
.select-item-txt
|
||||
width calc(100% - 50px)
|
||||
_font(15px, inherit, #999,,left)
|
||||
// padding 0 10px
|
||||
.select-item-button
|
||||
position relative
|
||||
_wh(50px, inherit)
|
||||
vertical-align top
|
||||
&::before
|
||||
content ''
|
||||
width 0
|
||||
height 0
|
||||
border-left 5px solid transparent
|
||||
border-right 5px solid transparent
|
||||
border-top 5px solid #999
|
||||
position absolute
|
||||
right 13px
|
||||
top 17px
|
||||
pointer-events none
|
||||
z-index 3
|
||||
.options
|
||||
position absolute
|
||||
z-index 100000
|
||||
top 44px
|
||||
width 100%
|
||||
padding 10px 0
|
||||
background-color #fff
|
||||
border 1px solid #eee
|
||||
border-radius 5px
|
||||
li
|
||||
width 100%
|
||||
_font(15px, 38px, #999,,left)
|
||||
padding 0 10px
|
||||
user-select none
|
||||
box-sizing border-box
|
||||
&:hover
|
||||
background-color #f5f7fa
|
||||
.li-active
|
||||
color #409eff
|
||||
</style>
|
||||
74
src/components/time.vue
Normal file
@@ -0,0 +1,74 @@
|
||||
<template>
|
||||
<div class="data_box">
|
||||
<div class="time">{{time}}</div>
|
||||
<div class="date_item">
|
||||
<div class="year">{{year}}</div>
|
||||
<div class="year">{{ date }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'Time',
|
||||
data () {
|
||||
return {
|
||||
timer: null,
|
||||
time: '',
|
||||
year: '',
|
||||
date: '',
|
||||
week: ''
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.timer = window.setInterval(this.updateTime, 1000)
|
||||
},
|
||||
methods: {
|
||||
updateTime () {
|
||||
let cd = new Date()
|
||||
let year = cd.getFullYear()
|
||||
let month = cd.getMonth() + 1 < 10 ? '0' + (cd.getMonth() + 1) : cd.getMonth() + 1
|
||||
let date = cd.getDate() < 10 ? '0' + cd.getDate() : cd.getDate()
|
||||
let hh = cd.getHours() < 10 ? '0' + cd.getHours() : cd.getHours()
|
||||
let mm = cd.getMinutes() < 10 ? '0' + cd.getMinutes() : cd.getMinutes()
|
||||
let ss = cd.getSeconds() < 10 ? '0' + cd.getSeconds() : cd.getSeconds()
|
||||
var weekday = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六']
|
||||
let myddy = new Date().getDay()
|
||||
let week = weekday[myddy]
|
||||
this.time = `${hh}:${mm}:${ss}`
|
||||
this.year = `${year}`
|
||||
this.date = `${month}.${date}`
|
||||
this.week = `${week}`
|
||||
}
|
||||
},
|
||||
beforeDestroy () {
|
||||
this.$once('hook:beforeDestroy', () => {
|
||||
clearInterval(this.timer)
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
.data_box
|
||||
position absolute
|
||||
right 30px
|
||||
top 21px
|
||||
width 300px
|
||||
height 39px
|
||||
display: flex
|
||||
justify-content: flex-end
|
||||
.time
|
||||
font-size: 39px;
|
||||
line-height: 29px;
|
||||
font-family: 'YouSheBiaoTiHei';
|
||||
color: #AECAF5;
|
||||
.date_item
|
||||
margin-left 10px
|
||||
.year
|
||||
font-size: 16px;
|
||||
font-family: 'YouSheBiaoTiHei';
|
||||
color: #AECAF5;
|
||||
line-height: 16px;
|
||||
opacity: 0.7;
|
||||
</style>
|
||||
14
src/config/filter.js
Normal file
@@ -0,0 +1,14 @@
|
||||
// import store from '../vuex/store'
|
||||
|
||||
const filter = {
|
||||
numeric (value) {
|
||||
if (value === '') return ''
|
||||
return Number(value).toFixed(3)
|
||||
},
|
||||
numFixed (value, bit) {
|
||||
if (value === '') return ''
|
||||
return Number(value).toFixed(bit)
|
||||
}
|
||||
}
|
||||
|
||||
export default filter
|
||||
3882
src/config/getData2.js
Normal file
65
src/config/http.js
Normal file
@@ -0,0 +1,65 @@
|
||||
import axios from 'axios'
|
||||
import { Dialog } from './mUtils.js'
|
||||
import store from '../vuex/store.js'
|
||||
import router from '@/router'
|
||||
|
||||
axios.defaults.timeout = 50000
|
||||
axios.defaults.headers.post['Content-Type'] = 'application/json;charset=UTF-8'
|
||||
|
||||
axios.interceptors.request.use(
|
||||
config => {
|
||||
// let token = ''
|
||||
// if (store.getters.userInfo !== '') {
|
||||
// token = JSON.parse(store.getters.userInfo).token
|
||||
// }
|
||||
// token && (config.headers.Authorization = token)
|
||||
if (config.method === 'post') {
|
||||
if (!config.data.flag) {
|
||||
config.data = config.data
|
||||
} else {
|
||||
config.data = config.data.formData
|
||||
}
|
||||
}
|
||||
return config
|
||||
},
|
||||
error => {
|
||||
Dialog('错误的传参')
|
||||
return Promise.reject(error)
|
||||
}
|
||||
)
|
||||
|
||||
axios.interceptors.response.use(
|
||||
response => {
|
||||
return Promise.resolve(response)
|
||||
},
|
||||
error => {
|
||||
if (error && error.response) {
|
||||
switch (error.response.status) {
|
||||
case 400:
|
||||
break
|
||||
case 401:
|
||||
// store.dispatch('setSignOut')
|
||||
router.push('/setup')
|
||||
break
|
||||
}
|
||||
return Promise.reject(error.response.data)
|
||||
} else {
|
||||
return Promise.reject(error)
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
export const post = (sevmethod, params) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
axios.post(`${store.getters.baseUrl}/` + sevmethod, params)
|
||||
.then(response => {
|
||||
resolve(response.data)
|
||||
}, error => {
|
||||
// Dialog(error.message)
|
||||
reject(error.message)
|
||||
})
|
||||
.catch((error) => {
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
}
|
||||
134
src/config/mUtils.js
Normal file
@@ -0,0 +1,134 @@
|
||||
import store from '../vuex/store'
|
||||
|
||||
/**
|
||||
* 弹出框
|
||||
*/
|
||||
export const Dialog = (str) => {
|
||||
store.dispatch('showAlert', true)
|
||||
store.dispatch('alertMsg', str)
|
||||
// setTimeout(() => {
|
||||
// store.dispatch('showAlert', false)
|
||||
// }, 30000)
|
||||
}
|
||||
|
||||
/**
|
||||
* 提示框
|
||||
*/
|
||||
export const toast = (str) => {
|
||||
store.dispatch('showToast', true)
|
||||
store.dispatch('toastMsg', str)
|
||||
setTimeout(() => {
|
||||
store.dispatch('showToast', false)
|
||||
}, 3000)
|
||||
}
|
||||
|
||||
/**
|
||||
* 存储localStorage
|
||||
*/
|
||||
export const setStore = (name, content) => {
|
||||
if (!name) return
|
||||
if (typeof content !== 'string') {
|
||||
content = JSON.stringify(content)
|
||||
}
|
||||
window.localStorage.setItem(name, content)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取localStorage
|
||||
*/
|
||||
export const getStore = name => {
|
||||
if (!name) return
|
||||
return window.localStorage.getItem(name)
|
||||
}
|
||||
|
||||
/**
|
||||
* 小数加法
|
||||
*/
|
||||
export const accAdd = (arg1, arg2) => {
|
||||
var r1, r2, m, c
|
||||
try {
|
||||
r1 = arg1.toString().split('.')[1].length
|
||||
} catch (e) {
|
||||
r1 = 0
|
||||
}
|
||||
try {
|
||||
r2 = arg2.toString().split('.')[1].length
|
||||
} catch (e) {
|
||||
r2 = 0
|
||||
}
|
||||
c = Math.abs(r1 - r2)
|
||||
m = Math.pow(10, Math.max(r1, r2))
|
||||
if (c > 0) {
|
||||
var cm = Math.pow(10, c)
|
||||
if (r1 > r2) {
|
||||
arg1 = Number(arg1.toString().replace('.', ''))
|
||||
arg2 = Number(arg2.toString().replace('.', '')) * cm
|
||||
} else {
|
||||
arg1 = Number(arg1.toString().replace('.', '')) * cm
|
||||
arg2 = Number(arg2.toString().replace('.', ''))
|
||||
}
|
||||
} else {
|
||||
arg1 = Number(arg1.toString().replace('.', ''))
|
||||
arg2 = Number(arg2.toString().replace('.', ''))
|
||||
}
|
||||
return (arg1 + arg2) / m
|
||||
}
|
||||
|
||||
/**
|
||||
* 小数减法
|
||||
*/
|
||||
export const accSubtract = (arg1, arg2) => {
|
||||
var r1, r2, m, c
|
||||
try {
|
||||
r1 = arg1.toString().split('.')[1].length
|
||||
} catch (e) {
|
||||
r1 = 0
|
||||
}
|
||||
try {
|
||||
r2 = arg2.toString().split('.')[1].length
|
||||
} catch (e) {
|
||||
r2 = 0
|
||||
}
|
||||
c = Math.abs(r1 - r2)
|
||||
m = Math.pow(10, Math.max(r1, r2))
|
||||
if (c > 0) {
|
||||
var cm = Math.pow(10, c)
|
||||
if (r1 > r2) {
|
||||
arg1 = Number(arg1.toString().replace('.', ''))
|
||||
arg2 = Number(arg2.toString().replace('.', '')) * cm
|
||||
} else {
|
||||
arg1 = Number(arg1.toString().replace('.', '')) * cm
|
||||
arg2 = Number(arg2.toString().replace('.', ''))
|
||||
}
|
||||
} else {
|
||||
arg1 = Number(arg1.toString().replace('.', ''))
|
||||
arg2 = Number(arg2.toString().replace('.', ''))
|
||||
}
|
||||
return (arg1 - arg2) / m
|
||||
}
|
||||
|
||||
/**
|
||||
* 小数乘法
|
||||
*/
|
||||
export const accMul = (arg1, arg2) => {
|
||||
var m = 0
|
||||
var s1 = arg1.toString()
|
||||
var s2 = arg2.toString()
|
||||
try { m += s1.split('.')[1].length } catch (e) {}
|
||||
try { m += s2.split('.')[1].length } catch (e) {}
|
||||
return Number(s1.replace('.', '')) * Number(s2.replace('.', '')) / Math.pow(10, m)
|
||||
}
|
||||
|
||||
/**
|
||||
* 求数组最大值
|
||||
*/
|
||||
export const maxArr = (arr) => {
|
||||
let max = Number(arr[0])
|
||||
let len = arr.length
|
||||
for (let i = 1; i < len; i++) {
|
||||
if (Number(arr[i]) > max) {
|
||||
max = Number(arr[i])
|
||||
}
|
||||
}
|
||||
return max
|
||||
}
|
||||
426
src/config/mork2.js
Normal file
@@ -0,0 +1,426 @@
|
||||
/**
|
||||
* 新版大屏首页左侧报表
|
||||
*/
|
||||
export const homepageDataLeft = () => {
|
||||
let res = {
|
||||
// 当日混料 最多7个元素
|
||||
'todayMix': [
|
||||
{
|
||||
// 物料编码
|
||||
'materialCode': 'GBMCZ3027L323217GM003ZX22-30',
|
||||
'materialName': '物料一',
|
||||
// 需生产
|
||||
'plan': 14,
|
||||
// 已生产
|
||||
'real': 17
|
||||
},
|
||||
{
|
||||
// 物料编码
|
||||
'materialCode': 'GBMCZ3027L323217GM003ZX22-30',
|
||||
'materialName': '物料二',
|
||||
// 需生产
|
||||
'plan': 14,
|
||||
// 已生产
|
||||
'real': 16
|
||||
},
|
||||
{
|
||||
// 物料编码
|
||||
'materialCode': 'GBMCZ3027L323217GM003ZX22-30',
|
||||
'materialName': '物料三',
|
||||
// 需生产
|
||||
'plan': 20,
|
||||
// 已生产
|
||||
'real': 16
|
||||
},
|
||||
{
|
||||
// 物料编码
|
||||
'materialCode': 'GBMCZ3027L323217GM003ZX22-30',
|
||||
'materialName': '物料四',
|
||||
// 需生产
|
||||
'plan': 14,
|
||||
// 已生产
|
||||
'real': 16
|
||||
},
|
||||
{
|
||||
// 物料编码
|
||||
'materialCode': 'GBMCZ3027L323217GM003ZX22-30',
|
||||
'materialName': '物料五',
|
||||
// 需生产
|
||||
'plan': 14,
|
||||
// 已生产
|
||||
'real': 16
|
||||
},
|
||||
{
|
||||
// 物料编码
|
||||
'materialCode': 'GBMCZ3027L323217GM003ZX22-31',
|
||||
'materialName': '物料6',
|
||||
// 需生产
|
||||
'plan': 14,
|
||||
// 已生产
|
||||
'real': 16
|
||||
},
|
||||
{
|
||||
// 物料编码
|
||||
'materialCode': 'GBMCZ3027L323217GM003ZX22-32',
|
||||
'materialName': '物料7',
|
||||
// 需生产
|
||||
'plan': 14,
|
||||
// 已生产
|
||||
'real': 16
|
||||
}
|
||||
],
|
||||
// 当日成品 最多7个元素
|
||||
'todaySort': [
|
||||
{
|
||||
// 物料编码
|
||||
'materialCode': 'GBMCZ3027L323217GM003ZX22-30',
|
||||
// 需生产
|
||||
'plan': 10,
|
||||
// 已压制
|
||||
'press': 20,
|
||||
// 已完成
|
||||
'real': 30
|
||||
},
|
||||
{
|
||||
// 物料编码
|
||||
'materialCode': 'GBMCZ3027L323217GM003ZX22-30',
|
||||
// 需生产
|
||||
'plan': 10,
|
||||
// 已压制
|
||||
'press': 20,
|
||||
// 已完成
|
||||
'real': 30
|
||||
},
|
||||
{
|
||||
// 物料编码
|
||||
'materialCode': 'GBMCZ3027L323217GM003ZX22-30',
|
||||
// 需生产
|
||||
'plan': 10,
|
||||
// 已压制
|
||||
'press': 20,
|
||||
// 已完成
|
||||
'real': 30
|
||||
},
|
||||
{
|
||||
// 物料编码
|
||||
'materialCode': 'GBMCZ3027L323217GM003ZX22-30',
|
||||
// 需生产
|
||||
'plan': 10,
|
||||
// 已压制
|
||||
'press': 20,
|
||||
// 已完成
|
||||
'real': 30
|
||||
},
|
||||
{
|
||||
// 物料编码
|
||||
'materialCode': 'GBMCZ3027L323217GM003ZX22-30',
|
||||
// 需生产
|
||||
'plan': 10,
|
||||
// 已压制
|
||||
'press': 20,
|
||||
// 已完成
|
||||
'real': 30
|
||||
},
|
||||
{
|
||||
// 物料编码
|
||||
'materialCode': 'GBMCZ3027L323217GM003ZX22-30',
|
||||
// 需生产
|
||||
'plan': 10,
|
||||
// 已压制
|
||||
'press': 20,
|
||||
// 已完成
|
||||
'real': 30
|
||||
},
|
||||
{
|
||||
// 物料编码
|
||||
'materialCode': 'GBMCZ3027L323217GM003ZX22-30',
|
||||
// 需生产
|
||||
'plan': 10,
|
||||
// 已压制
|
||||
'press': 20,
|
||||
// 已完成
|
||||
'real': 30
|
||||
}
|
||||
],
|
||||
// 今日生产
|
||||
'todayProduction': {
|
||||
// 压制
|
||||
'todayPressProduction': {
|
||||
// 已生产
|
||||
'real': 2122,
|
||||
// 计划生产
|
||||
'plan': 8400
|
||||
},
|
||||
// 包装
|
||||
'todaySortProduction': {
|
||||
// 已生产
|
||||
'real': 0,
|
||||
// 计划生产
|
||||
'plan': 0
|
||||
},
|
||||
// 订单完成
|
||||
'orderFulfillmentRate': {
|
||||
// 已生产
|
||||
'real': 2122,
|
||||
// 计划生产
|
||||
'plan': 8400
|
||||
},
|
||||
// 混料
|
||||
'todayMixProduction': {
|
||||
// 已生产
|
||||
'real': 0.0,
|
||||
// 计划生产
|
||||
'plan': 0.0
|
||||
},
|
||||
todayTotalPlan: '80',
|
||||
materialCountSize: '2',
|
||||
sortCompleted: '11',
|
||||
sortCompletedQty: '900',
|
||||
sortMaterialCountSize: '1',
|
||||
fulfillmentRate: '25'
|
||||
// 信息
|
||||
// 'message': '今日共需生产<span>8400</span>块,物料种类2种,已完成包装11托,共900块,1个物料,完成率25%。'
|
||||
},
|
||||
// 历史分析 固定7个元素
|
||||
'history': [
|
||||
{
|
||||
// 日期
|
||||
'date': '12月31日',
|
||||
// 成品
|
||||
'sort': 0,
|
||||
// 压制
|
||||
'press': 1890
|
||||
},
|
||||
{
|
||||
'date': '12月31日',
|
||||
'sort': 0,
|
||||
'press': 2640
|
||||
},
|
||||
{
|
||||
'date': '12月31日',
|
||||
'sort': 0,
|
||||
'press': 5364
|
||||
},
|
||||
{
|
||||
'date': '12月31日',
|
||||
'sort': 720,
|
||||
'press': 4962
|
||||
},
|
||||
{
|
||||
'date': '12月31日',
|
||||
'sort': 1584,
|
||||
'press': 1260
|
||||
},
|
||||
{
|
||||
'date': '12月31日',
|
||||
'sort': 1872,
|
||||
'press': 2400
|
||||
},
|
||||
{
|
||||
'date': '12月31日',
|
||||
'sort': 576,
|
||||
'press': 630
|
||||
}
|
||||
],
|
||||
// 库存量监控 最多7个元素
|
||||
'inventory': [
|
||||
{
|
||||
// 物料编码
|
||||
'materialCode': 'GBMCZ3027L323217GM003ZX22-31',
|
||||
'materialName': '物料一',
|
||||
// 数量
|
||||
'qty': 1
|
||||
},
|
||||
{
|
||||
// 物料编码
|
||||
'materialCode': 'GBMCZ3027L323217GM003ZX22-32',
|
||||
'materialName': '物料二',
|
||||
// 数量
|
||||
'qty': 2
|
||||
},
|
||||
{
|
||||
// 物料编码
|
||||
'materialCode': 'GBMCZ3027L323217GM003ZX22-3',
|
||||
'materialName': '物料三',
|
||||
// 数量
|
||||
'qty': 3
|
||||
},
|
||||
{
|
||||
// 物料编码
|
||||
'materialCode': 'GBMCZ3027L323217GM003ZX22-4',
|
||||
'materialName': '物料四',
|
||||
// 数量
|
||||
'qty': 4
|
||||
},
|
||||
{
|
||||
// 物料编码
|
||||
'materialCode': 'GBMCZ3027L323217GM003ZX22-5',
|
||||
'materialName': '物料五',
|
||||
// 数量
|
||||
'qty': 5
|
||||
},
|
||||
{
|
||||
// 物料编码
|
||||
'materialCode': 'GBMCZ3027L323217GM003ZX22-6',
|
||||
'materialName': '物料6',
|
||||
// 数量
|
||||
'qty': 6
|
||||
},
|
||||
{
|
||||
// 物料编码
|
||||
'materialCode': 'GBMCZ3027L323217GM003ZX22-7',
|
||||
'materialName': '物料7',
|
||||
// 数量
|
||||
'qty': 7
|
||||
}
|
||||
]
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
/**
|
||||
* 新版大屏首页右侧报表
|
||||
*/
|
||||
export const homepageDataRight = () => {
|
||||
let res = {
|
||||
'capacityRate': [{'device_name': '混料设备', 'numerical': '60'}, {'device_name': '压制设备', 'numerical': '60'}, {'device_name': '压制设备2', 'numerical': '60'}, {'device_name': '压制设备3', 'numerical': '60'}],
|
||||
'stateStatistics': {
|
||||
count: '20',
|
||||
fourState: [{'status': '5', 'stateName': '正常运行'}, {'status': '5', 'stateName': '暂未生产'}, {'status': '5', 'stateName': '空闲设备'}, {'status': '5', 'stateName': '故障设备'}]
|
||||
},
|
||||
'areaDeviceStatus': {
|
||||
'mix': {
|
||||
'running': 7,
|
||||
'pausing': 3,
|
||||
'shutdown': 4,
|
||||
'inTrouble': 1
|
||||
},
|
||||
'press': {
|
||||
'running': 4,
|
||||
'pausing': 2,
|
||||
'shutdown': 1,
|
||||
'inTrouble': 0
|
||||
},
|
||||
'dry': {
|
||||
'running': 4,
|
||||
'pausing': 7,
|
||||
'shutdown': 8,
|
||||
'inTrouble': 2
|
||||
},
|
||||
'sort': {
|
||||
'running': 7,
|
||||
'pausing': 3,
|
||||
'shutdown': 3,
|
||||
'inTrouble': 1
|
||||
}
|
||||
},
|
||||
'top10Of30Days': [
|
||||
{
|
||||
'device_name': '压机1',
|
||||
'count': 10
|
||||
},
|
||||
{
|
||||
'device_name': '压机2',
|
||||
'count': 9
|
||||
},
|
||||
{
|
||||
'device_name': '混料机1',
|
||||
'count': 8
|
||||
},
|
||||
{
|
||||
'device_name': '窑1',
|
||||
'count': 7
|
||||
},
|
||||
{
|
||||
'device_name': '分拣拆垛机械手1',
|
||||
'count': 6
|
||||
},
|
||||
{
|
||||
'device_name': '压机7',
|
||||
'count': 5
|
||||
},
|
||||
{
|
||||
'device_name': '码垛机械手1',
|
||||
'count': 4
|
||||
},
|
||||
{
|
||||
'device_name': '窑前桁架1',
|
||||
'count': 3
|
||||
},
|
||||
{
|
||||
'device_name': '拆盘机1',
|
||||
'count': 2
|
||||
},
|
||||
{
|
||||
'device_name': '覆膜机1',
|
||||
'count': 1
|
||||
}
|
||||
],
|
||||
'deviceWorkOrder': [
|
||||
{
|
||||
'process': '压制',
|
||||
'deviceCode': 'YJ01',
|
||||
'deviceName': '压机1',
|
||||
'status': '2',
|
||||
'workOrder': 'GD0001',
|
||||
'bom': '1001C1',
|
||||
'material': 'ZLMCZ1001C122211GM001BD20-8',
|
||||
'qty': '1000块',
|
||||
'startTime': '2023-11-20 14:32:32'
|
||||
},
|
||||
{
|
||||
'process': '压制',
|
||||
'deviceCode': 'YJ01',
|
||||
'deviceName': '压机1',
|
||||
'status': '0',
|
||||
'workOrder': 'GD0001',
|
||||
'bom': '1001C1',
|
||||
'material': 'ZLMCZ1001C122211GM001BD20-8',
|
||||
'qty': '1000块',
|
||||
'startTime': '2023-11-20 14:32:32'
|
||||
},
|
||||
{
|
||||
'process': '压制',
|
||||
'deviceCode': 'YJ01',
|
||||
'deviceName': '压机1',
|
||||
'status': '1',
|
||||
'workOrder': 'GD0001',
|
||||
'bom': '1001C1',
|
||||
'material': 'ZLMCZ1001C122211GM001BD20-8',
|
||||
'qty': '1000块',
|
||||
'startTime': '2023-11-20 14:32:32'
|
||||
},
|
||||
{
|
||||
'process': '压制',
|
||||
'deviceCode': 'YJ01',
|
||||
'deviceName': '压机1',
|
||||
'status': '1',
|
||||
'workOrder': 'GD0001',
|
||||
'bom': '1001C1',
|
||||
'material': 'ZLMCZ1001C122211GM001BD20-8',
|
||||
'qty': '1000块',
|
||||
'startTime': '2023-11-20 14:32:32'
|
||||
},
|
||||
{
|
||||
'process': '压制',
|
||||
'deviceCode': 'YJ01',
|
||||
'deviceName': '压机1',
|
||||
'status': '1',
|
||||
'workOrder': 'GD0001',
|
||||
'bom': '1001C1',
|
||||
'material': 'ZLMCZ1001C122211GM001BD20-8',
|
||||
'qty': '1000块',
|
||||
'startTime': '2023-11-20 14:32:32'
|
||||
}
|
||||
]
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
/**
|
||||
* 大屏首页设备
|
||||
*/
|
||||
export const homepageEquipment = () => {
|
||||
let res = {'productReport': [{'number': '192块', 'create_time': '2023-11-18 13:33:52', 'material_code': 'GBMAC3019C123270GM005BB20-30'}, {'number': '324块', 'create_time': '2023-11-11 15:45:02', 'material_code': 'GBMAC3003C123268GM002BB19-8'}, {'number': '240块', 'create_time': '2023-11-11 13:19:43', 'material_code': 'GBMAC3038C223271GM016BB25-30'}, {'number': '324块', 'create_time': '2023-11-11 10:58:42', 'material_code': 'GBMAC3003C123268GM002BB19-8'}, {'number': '240块', 'create_time': '2023-11-08 09:19:05', 'material_code': 'GBMCZ3059L323288GM029ZJTH21-10'}, {'number': '126块', 'create_time': '2023-11-06 16:04:40', 'material_code': 'GBMCZ3053M223268GM002ZJTH-201'}, {'number': '270块', 'create_time': '2023-11-06 15:41:37', 'material_code': 'GBMCZ3053M223268GM002ZJTH-201'}, {'number': '270块', 'create_time': '2023-11-06 14:57:32', 'material_code': 'GBMCZ3053M223268GM002ZJTH-201'}, {'number': '270块', 'create_time': '2023-11-06 14:12:48', 'material_code': 'GBMCZ3053M223268GM002ZJTH-201'}, {'number': '270块', 'create_time': '2023-11-06 13:28:01', 'material_code': 'GBMCZ3053M223268GM002ZJTH-201'}, {'number': '270块', 'create_time': '2023-11-06 12:41:13', 'material_code': 'GBMCZ3053M223268GM002ZJTH-201'}, {'number': '270块', 'create_time': '2023-11-06 11:03:33', 'material_code': 'GBMCZ3053M223268GM002ZJTH-201'}, {'number': '270块', 'create_time': '2023-11-06 10:16:51', 'material_code': 'GBMCZ3053M223268GM002ZJTH-201'}, {'number': '246块', 'create_time': '2023-11-04 15:44:12', 'material_code': 'GBMCZ3053M223268GM002ZJTH-201'}, {'number': '210块', 'create_time': '2023-11-04 13:09:49', 'material_code': 'GBMCZ3053M223268GM002ZJTH-201'}, {'number': '210块', 'create_time': '2023-11-04 12:35:26', 'material_code': 'GBMCZ3053M223268GM002ZJTH-201'}, {'number': '210块', 'create_time': '2023-11-04 11:11:36', 'material_code': 'GBMCZ3053M223268GM002ZJTH-201'}, {'number': '240块', 'create_time': '2023-11-04 10:36:37', 'material_code': 'GBMCZ3059L323288GM029ZJTH21-10'}, {'number': '210块', 'create_time': '2023-11-04 10:35:52', 'material_code': 'GBMCZ3053M223268GM002ZJTH-201'}, {'number': '210块', 'create_time': '2023-11-04 10:09:29', 'material_code': 'GBMCZ3053M223268GM002ZJTH-201'}], 'deviceReport': [{'failure_info': '99', 'device_code': 'FJMDJXS01', 'failure_time': '2023-11-27 09:33:21'}, {'failure_info': '2', 'device_code': 'MDJXS01', 'failure_time': '2023-11-25 16:02:40'}, {'failure_info': '-', 'device_code': 'MDJXS02', 'failure_time': '2023-11-25 14:02:22'}, {'failure_info': '1', 'device_code': 'BZJ01', 'failure_time': '2023-11-25 08:01:38'}, {'failure_info': '-', 'device_code': 'JYHJ01', 'failure_time': '2023-11-22 13:24:07'}, {'failure_info': '-', 'device_code': 'CPJ01', 'failure_time': '2023-11-20 11:03:01'}, {'failure_info': '-', 'device_code': 'RGV01', 'failure_time': '2023-11-17 13:59:38'}, {'failure_info': '-', 'device_code': 'MDJXS03', 'failure_time': '2023-11-15 15:02:08'}, {'failure_info': '-', 'device_code': 'MDJXS04', 'failure_time': '2023-11-03 07:37:52'}, {'failure_info': '-', 'device_code': 'CYHJ01', 'failure_time': '2023-10-25 11:47:21'}]}
|
||||
return res
|
||||
}
|
||||
13
src/config/rem.js
Normal file
@@ -0,0 +1,13 @@
|
||||
(function (doc, win) {
|
||||
var docEl = doc.documentElement
|
||||
var resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize'
|
||||
var recalc = function () {
|
||||
var clientWidth = docEl.clientWidth
|
||||
if (!clientWidth) return
|
||||
docEl.style.fontSize = 100 * (clientWidth / 1920) + 'px'
|
||||
document.body.style.display = 'block'
|
||||
}
|
||||
if (!doc.addEventListener) return win.addEventListener(resizeEvt, recalc, false)
|
||||
doc.addEventListener('DOMContentLoaded', recalc, false)
|
||||
})(document, window)
|
||||
// 晟华大屏尺寸2560*1440,屏幕太大用rem样式会错乱,现在使用px、%
|
||||
BIN
src/images/bg-button_left.png
Executable file
|
After Width: | Height: | Size: 54 KiB |
BIN
src/images/bg-button_right.png
Executable file
|
After Width: | Height: | Size: 52 KiB |
BIN
src/images/bg-center_left.jpg
Executable file
|
After Width: | Height: | Size: 616 KiB |
BIN
src/images/bg-center_right.jpg
Executable file
|
After Width: | Height: | Size: 488 KiB |
BIN
src/images/bg-home_left.jpg
Executable file
|
After Width: | Height: | Size: 708 KiB |
BIN
src/images/bg-home_right.jpg
Executable file
|
After Width: | Height: | Size: 748 KiB |
BIN
src/images/bg-left.png
Normal file
|
After Width: | Height: | Size: 32 KiB |
BIN
src/images/bg-login.jpg
Normal file
|
After Width: | Height: | Size: 59 KiB |
BIN
src/images/bg-m_1.png
Normal file
|
After Width: | Height: | Size: 57 KiB |
BIN
src/images/bg-m_2.png
Normal file
|
After Width: | Height: | Size: 44 KiB |
BIN
src/images/bg-right.png
Normal file
|
After Width: | Height: | Size: 29 KiB |
BIN
src/images/bg-title_1.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
src/images/bg-title_2.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
src/images/bg-title_3.png
Normal file
|
After Width: | Height: | Size: 5.9 KiB |
BIN
src/images/bg-top_left.png
Executable file
|
After Width: | Height: | Size: 72 KiB |
BIN
src/images/bg-top_right.png
Executable file
|
After Width: | Height: | Size: 72 KiB |
BIN
src/images/bg1.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
src/images/bg2.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
src/images/bg3.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
src/images/bg4.png
Normal file
|
After Width: | Height: | Size: 166 B |
BIN
src/images/fk_1.png
Normal file
|
After Width: | Height: | Size: 541 B |
BIN
src/images/fk_2.png
Normal file
|
After Width: | Height: | Size: 552 B |
BIN
src/images/fk_3.png
Normal file
|
After Width: | Height: | Size: 609 B |
BIN
src/images/fk_4.png
Normal file
|
After Width: | Height: | Size: 568 B |
BIN
src/images/fk_5.png
Normal file
|
After Width: | Height: | Size: 549 B |
BIN
src/images/fk_6.png
Executable file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
src/images/fk_7.png
Executable file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
src/images/gl-bg_1.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
src/images/gl-bg_2.png
Normal file
|
After Width: | Height: | Size: 23 KiB |
BIN
src/images/gl-bg_3.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
src/images/light_1.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
src/images/line_selected.png
Normal file
|
After Width: | Height: | Size: 1005 B |
BIN
src/images/message-bg.png
Normal file
|
After Width: | Height: | Size: 46 KiB |
BIN
src/images/pie-bg_1.png
Normal file
|
After Width: | Height: | Size: 56 KiB |
BIN
src/images/pie-bg_2.png
Normal file
|
After Width: | Height: | Size: 60 KiB |
BIN
src/images/pie_1.png
Normal file
|
After Width: | Height: | Size: 23 KiB |
BIN
src/images/pointer.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
src/images/state_0.png
Normal file
|
After Width: | Height: | Size: 489 B |
BIN
src/images/state_1.png
Normal file
|
After Width: | Height: | Size: 459 B |
BIN
src/images/state_2.png
Normal file
|
After Width: | Height: | Size: 482 B |
BIN
src/images/state_3.png
Normal file
|
After Width: | Height: | Size: 461 B |
BIN
src/images/symbol_1.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
src/images/symbol_2.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
src/images/symbol_3.png
Normal file
|
After Width: | Height: | Size: 110 B |
BIN
src/images/symbol_4.png
Normal file
|
After Width: | Height: | Size: 110 B |
BIN
src/images/table-bg_1.png
Normal file
|
After Width: | Height: | Size: 13 KiB |
26
src/main.js
Normal file
@@ -0,0 +1,26 @@
|
||||
import 'babel-polyfill'
|
||||
import Vue from 'vue'
|
||||
import App from './App'
|
||||
import router from './router'
|
||||
import store from './vuex/store'
|
||||
import './style/reset.css'
|
||||
import './style/layout.styl'
|
||||
import * as echarts from 'echarts'
|
||||
import 'default-passive-events'
|
||||
import VueParticles from 'vue-particles'
|
||||
import scroll from 'vue-seamless-scroll'
|
||||
import {Message} from 'element-ui'
|
||||
|
||||
Vue.prototype.$echarts = echarts
|
||||
Vue.use(VueParticles)
|
||||
Vue.use(scroll)
|
||||
Vue.prototype.$message = Message
|
||||
Vue.config.productionTip = false
|
||||
/* eslint-disable no-new */
|
||||
new Vue({
|
||||
el: '#app',
|
||||
router,
|
||||
store,
|
||||
components: { App },
|
||||
template: '<App/>'
|
||||
})
|
||||
220
src/pages/Setup.vue
Normal file
@@ -0,0 +1,220 @@
|
||||
<template>
|
||||
<div class="login-container">
|
||||
<vue-particles
|
||||
color="#fff"
|
||||
:particleOpacity="0.7"
|
||||
:particlesNumber="60"
|
||||
shapeType="circle"
|
||||
:particleSize="4"
|
||||
linesColor="#fff"
|
||||
:linesWidth="1"
|
||||
:lineLinked="true"
|
||||
:lineOpacity="0.4"
|
||||
:linesDistance="150"
|
||||
:moveSpeed="2"
|
||||
:hoverEffect="true"
|
||||
hoverMode="grab"
|
||||
:clickEffect="true"
|
||||
clickMode="push"
|
||||
class="lizi"
|
||||
>
|
||||
</vue-particles>
|
||||
<div class="body-container">
|
||||
<div class="login_wrap">
|
||||
<div class="login_cnt">
|
||||
<div class="title-name">系统配置</div>
|
||||
<div class="login_card">
|
||||
<div class="card_wrap">
|
||||
<div class="inputOuter">
|
||||
<label>域名地址</label>
|
||||
<input type="text" class="inputStyle" v-model="baseUrl">
|
||||
</div>
|
||||
<div class="inputOuter">
|
||||
<label>刷新时间(秒)</label>
|
||||
<input type="number" class="inputStyle" v-model="setTime">
|
||||
</div>
|
||||
<div class="inputOuter">
|
||||
<label>设备看板</label>
|
||||
<!-- <select name="equipment" v-model="equipId">
|
||||
<option :value="e.id" v-for="e in equipment" :key="e.id">{{e.name}}</option>
|
||||
</select> -->
|
||||
<div class="select-wraper">
|
||||
<selectOpt :option="option" :index="index" @change="change"></SelectOpt>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button class="btn" @click="_config">配置</button>
|
||||
<!-- <button class="btn" @click="getCc">获取尺寸</button> -->
|
||||
<!-- <div class="submit"><input type="submit" value="配 置" class="btn" @click="_config"></div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import SelectOpt from '@components/select.vue'
|
||||
export default {
|
||||
components: {
|
||||
SelectOpt
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
loginname: '',
|
||||
password: '',
|
||||
option: [{index: '1', label: '新-左'}, {index: '2', label: '新-右'}],
|
||||
index: this.$store.getters.equipId,
|
||||
baseUrl: this.$store.getters.baseUrl,
|
||||
setTime: this.$store.getters.setTime / 1000,
|
||||
fullscreen: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getCc () {
|
||||
const screenWidth = window.screen.width
|
||||
const screenHeight = window.screen.height
|
||||
alert('宽:' + screenWidth + ';' + '高:' + screenHeight + ';')
|
||||
},
|
||||
change (e) {
|
||||
this.index = e
|
||||
},
|
||||
_config () {
|
||||
if (this.setTime > 10800) {
|
||||
this.$message({
|
||||
message: '刷新时间设置过长',
|
||||
type: 'warning'
|
||||
})
|
||||
return
|
||||
}
|
||||
let obj = {
|
||||
baseUrl: this.baseUrl,
|
||||
setTime: this.setTime * 1000,
|
||||
equipId: this.index
|
||||
}
|
||||
this.$store.dispatch('setConfig', obj)
|
||||
if (this.index === '1') {
|
||||
this.$router.push('/lindex')
|
||||
} else if (this.index === '2') {
|
||||
this.$router.push('/rindex')
|
||||
}
|
||||
let element = document.documentElement
|
||||
if (this.fullscreen) {
|
||||
if (document.exitFullscreen) {
|
||||
document.exitFullscreen()
|
||||
} else if (document.webkitCancelFullScreen) {
|
||||
document.webkitCancelFullScreen()
|
||||
} else if (document.mozCancelFullScreen) {
|
||||
document.mozCancelFullScreen()
|
||||
} else if (document.msExitFullscreen) {
|
||||
document.msExitFullscreen()
|
||||
}
|
||||
} else {
|
||||
if (element.requestFullscreen) {
|
||||
element.requestFullscreen()
|
||||
} else if (element.webkitRequestFullScreen) {
|
||||
element.webkitRequestFullScreen()
|
||||
} else if (element.mozRequestFullScreen) {
|
||||
element.mozRequestFullScreen()
|
||||
} else if (element.msRequestFullscreen) {
|
||||
// IE11
|
||||
element.msRequestFullscreen()
|
||||
}
|
||||
}
|
||||
this.fullscreen = !this.fullscreen
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
@import '~@style/mixin'
|
||||
.login-container
|
||||
position relative
|
||||
_wh(100%, 100%)
|
||||
z-index 1
|
||||
background center / 100% url('../images/bg-login.jpg') no-repeat
|
||||
.lizi
|
||||
position absolute
|
||||
top 0
|
||||
left 0
|
||||
z-index 2
|
||||
_wh(100%, 100%)
|
||||
.body-container
|
||||
position relative
|
||||
z-index 3
|
||||
_wh(100%, 100%)
|
||||
_fj(row, center)
|
||||
margin 0 auto
|
||||
.login_wrap
|
||||
width 500px
|
||||
background-color rgba(255, 255, 255, 0.8)
|
||||
border-radius 5px
|
||||
.login_tab
|
||||
position relative
|
||||
height 50px
|
||||
font-size 0
|
||||
background-color rgba(255, 255, 255, 0.9)
|
||||
border-radius 5px 5px 0 0
|
||||
.login_tab_item
|
||||
float left
|
||||
width 50%
|
||||
font-size 16px
|
||||
line-height 50px
|
||||
color #333333
|
||||
text-align center
|
||||
cursor pointer
|
||||
.login_tab_line
|
||||
position absolute
|
||||
width 50%
|
||||
height 2px
|
||||
background-color #2778f3
|
||||
left 0
|
||||
bottom 0
|
||||
.login_cnt
|
||||
width 100%
|
||||
padding 15px
|
||||
.title-name
|
||||
_font(16px, 28px, #000,,center)
|
||||
margin-bottom 10px
|
||||
.login_card
|
||||
width 100%
|
||||
.inputOuter
|
||||
_fj(row)
|
||||
height 38px
|
||||
line-height 38px
|
||||
width 100%
|
||||
margin-bottom 12px
|
||||
.inputStyle, .select-wraper
|
||||
_wh(calc(100% - 116px), 38px)
|
||||
font-size 15px
|
||||
background none
|
||||
line-height 38px
|
||||
color #999999
|
||||
text-indent 10px
|
||||
border none
|
||||
box-sizing border-box
|
||||
background-color #ffffff
|
||||
.submit
|
||||
width 100%
|
||||
background-color #2778f3
|
||||
border-radius 3px
|
||||
margin-top 5px
|
||||
.btn
|
||||
background-color #2778f3
|
||||
border-radius 3px
|
||||
margin-top 5px
|
||||
height 40px
|
||||
font-size 18px
|
||||
color #fff
|
||||
line-height 39px
|
||||
width 100%
|
||||
outline none
|
||||
border none
|
||||
font-weight normal
|
||||
label
|
||||
width 115px
|
||||
font-size 15px
|
||||
line-height 38px
|
||||
color #333333
|
||||
</style>
|
||||
117
src/pages/modules/home/left/index.vue
Normal file
@@ -0,0 +1,117 @@
|
||||
<template>
|
||||
<div class="n_container">
|
||||
<!-- <div class="style_block" style="left: calc(100% / 3);top:0;"></div>
|
||||
<div class="style_block" style="background: green;left: calc(100% / 3);top:calc(100% / 3);"></div>
|
||||
<div class="style_block" style="left: calc(100% / 3);bottom: 0"></div>
|
||||
<div class="style_block" style="background: green;left: calc(200% / 3);top:0;"></div>
|
||||
<div class="style_block" style="left: calc(200% / 3);top:calc(100% / 3);"></div>
|
||||
<div class="style_block" style="background: blue;left: calc(200% / 3);bottom: 0"></div>
|
||||
<div class="style_block" style="background: yellow;top: calc(100% / 3);bottom: 0"></div> -->
|
||||
<div class="n_header">
|
||||
<div class="n_header_h1">
|
||||
<h1>生产数据</h1>
|
||||
</div>
|
||||
<div class="n_header_h2">
|
||||
<h2>辽宁晟华耐火材料有限公司</h2>
|
||||
</div>
|
||||
</div>
|
||||
<div class="left_bg"></div>
|
||||
<div class="button_bg"></div>
|
||||
<div class="n_body_container">
|
||||
<div class="n_left_wraper">
|
||||
<left-page></left-page>
|
||||
</div>
|
||||
<div class="n_right_wraper">
|
||||
<right-page></right-page>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import leftPage from './left.vue'
|
||||
import rightPage from './right.vue'
|
||||
export default {
|
||||
components: {
|
||||
leftPage,
|
||||
rightPage
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
.n_container
|
||||
position relative
|
||||
width 100%
|
||||
height 100%
|
||||
background center / 100% url('../../../../images/bg-home_left.jpg') no-repeat
|
||||
overflow hidden
|
||||
.n_header
|
||||
position absolute
|
||||
left 0
|
||||
top 0
|
||||
width 100%
|
||||
height 181px
|
||||
background center / 100% url('../../../../images/bg-top_left.png') no-repeat
|
||||
.n_header_h1
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
padding-top 26px
|
||||
h1
|
||||
font-size: 60px;
|
||||
font-family: 'YouSheBiaoTiHei';
|
||||
font-weight: 400;
|
||||
color: transparent;
|
||||
line-height: 44px;
|
||||
opacity: 0.89;
|
||||
letter-spacing 18px
|
||||
background: linear-gradient(0deg, #AAD0F6 0%, #D7E7F5 53.3154296875%, #E0EAF6 100%);
|
||||
filter: drop-shadow(#092F6D 1px 4px 1px);
|
||||
-webkit-background-clip: text;
|
||||
background-clip: text;
|
||||
text-align right
|
||||
margin-right -9px
|
||||
.n_header_h2
|
||||
position absolute
|
||||
top 18px
|
||||
left 29px
|
||||
width 562px
|
||||
height 31px
|
||||
h2
|
||||
font-size: 42px;
|
||||
font-family: 'YouSheBiaoTiHei';
|
||||
font-weight: 400;
|
||||
color: transparent;
|
||||
line-height: 29px;
|
||||
background: linear-gradient(0deg, #B6C3D3 0%, #E3E9F2 53.3154296875%, #FEFEFE 100%);
|
||||
-webkit-background-clip: text;
|
||||
background-clip: text;
|
||||
.left_bg
|
||||
position absolute
|
||||
left 0
|
||||
top 111px
|
||||
width 34px
|
||||
height 839px
|
||||
background center / 100% url('../../../../images/bg-left.png') no-repeat
|
||||
.button_bg
|
||||
position absolute
|
||||
left 0
|
||||
bottom 0
|
||||
width 100%
|
||||
height 46px
|
||||
background center / 100% url('../../../../images/bg-button_left.png') no-repeat
|
||||
.n_body_container
|
||||
width 100%
|
||||
height 100%
|
||||
padding 125px 0 50px 50px
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
.n_left_wraper
|
||||
width 935px
|
||||
height 100%
|
||||
.n_right_wraper
|
||||
width calc(100% - 965px)
|
||||
height 100%
|
||||
padding-top 5px
|
||||
</style>
|
||||
1225
src/pages/modules/home/left/left.vue
Normal file
10
src/pages/modules/home/left/right.vue
Normal file
@@ -0,0 +1,10 @@
|
||||
<template>
|
||||
<div class="right_wraper"></div>
|
||||
</template>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
@import '~@style/mixin'
|
||||
.right_wraper
|
||||
_wh(100%, 100%)
|
||||
background center / 100% 100% url('../../../../images/bg-center_left.jpg') no-repeat
|
||||
</style>
|
||||
95
src/pages/modules/home/right/index.vue
Normal file
@@ -0,0 +1,95 @@
|
||||
<template>
|
||||
<div class="n_container">
|
||||
<div class="n_header">
|
||||
<div class="n_header_h1">
|
||||
<h1>控制中心</h1>
|
||||
</div>
|
||||
<v-time></v-time>
|
||||
</div>
|
||||
<div class="right_bg"></div>
|
||||
<div class="button_bg"></div>
|
||||
<div class="n_body_container">
|
||||
<div class="n_left_wraper">
|
||||
<left-page></left-page>
|
||||
</div>
|
||||
<div class="n_right_wraper">
|
||||
<right-page></right-page>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import leftPage from './left.vue'
|
||||
import rightPage from './right.vue'
|
||||
import vTime from '@components/time.vue'
|
||||
export default {
|
||||
components: {
|
||||
leftPage,
|
||||
rightPage,
|
||||
vTime
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
.n_container
|
||||
position relative
|
||||
width 100%
|
||||
height 100%
|
||||
background center / 100% url('../../../../images/bg-home_right.jpg') no-repeat
|
||||
overflow hidden
|
||||
.n_header
|
||||
position absolute
|
||||
left 0
|
||||
top 0
|
||||
width 100%
|
||||
height 181px
|
||||
background center / 100% url('../../../../images/bg-top_right.png') no-repeat
|
||||
.n_header_h1
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
padding-top 26px
|
||||
h1
|
||||
font-size: 60px;
|
||||
font-family: 'YouSheBiaoTiHei';
|
||||
font-weight: 400;
|
||||
color: transparent;
|
||||
line-height: 44px;
|
||||
opacity: 0.89;
|
||||
letter-spacing 18px
|
||||
background: linear-gradient(0deg, #AAD0F6 0%, #D7E7F5 53.3154296875%, #E0EAF6 100%);
|
||||
filter: drop-shadow(#092F6D 1px 4px 1px);
|
||||
-webkit-background-clip: text;
|
||||
background-clip: text;
|
||||
text-align left
|
||||
padding-left 9px
|
||||
.right_bg
|
||||
position absolute
|
||||
right 0
|
||||
top 111px
|
||||
width 34px
|
||||
height 839px
|
||||
background center / 100% url('../../../../images/bg-right.png') no-repeat
|
||||
.button_bg
|
||||
position absolute
|
||||
left 0
|
||||
bottom 0
|
||||
width 100%
|
||||
height 46px
|
||||
background center / 100% url('../../../../images/bg-button_right.png') no-repeat
|
||||
.n_body_container
|
||||
width 100%
|
||||
height 100%
|
||||
padding 125px 50px 50px 0
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
.n_left_wraper
|
||||
width calc(100% - 965px)
|
||||
height 100%
|
||||
padding-top 5px
|
||||
.n_right_wraper
|
||||
width 935px
|
||||
height 100%
|
||||
</style>
|
||||
174
src/pages/modules/home/right/left.vue
Normal file
@@ -0,0 +1,174 @@
|
||||
<template>
|
||||
<div class="left_wraper">
|
||||
<div class="table_wraper_1">
|
||||
<div class="scroll_wrap">
|
||||
<div class="scroll_title">
|
||||
<p>生产完成</p>
|
||||
</div>
|
||||
<div class="scroll_container_1">
|
||||
<vue-seamless-scroll :data="productReport" :class-option="defaultOption1">
|
||||
<ul class="scroll-ul_1">
|
||||
<li v-for="(e, i) in productReport" :key="i">
|
||||
<div class="scroll-ul_1_div">{{e.create_time}}</div>
|
||||
<div class="scroll-ul_1_div">{{e.material_code}}</div>
|
||||
<div class="scroll-ul_1_div">{{e.number}}</div>
|
||||
</li>
|
||||
</ul>
|
||||
</vue-seamless-scroll>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table_wraper_2">
|
||||
<div class="scroll_wrap">
|
||||
<div class="scroll_title">
|
||||
<p>设备状态</p>
|
||||
</div>
|
||||
<div class="scroll_container_1">
|
||||
<vue-seamless-scroll :data="deviceReport" :class-option="defaultOption1">
|
||||
<ul class="scroll-ul_1 scroll-ul_2">
|
||||
<li v-for="(e, i) in deviceReport" :key="i">
|
||||
<div class="scroll-ul_1_div">{{e.failure_time}}</div>
|
||||
<div class="scroll-ul_1_div">{{e.device_code}}</div>
|
||||
<div class="scroll-ul_1_div">
|
||||
<span class="state" :class="'state_' + e.failure_info"></span>
|
||||
<p class="state_name">{{['关机', '待机', '生产中', '故障'][Number(e.failure_info)]}}</p>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</vue-seamless-scroll>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// import { homepageEquipment } from '@js/mork2.js'
|
||||
import { homepageEquipment } from '@js/getData2.js'
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
interTime: this.$store.getters.setTime,
|
||||
timer: null,
|
||||
productReport: [],
|
||||
deviceReport: []
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
defaultOption1 () {
|
||||
return {
|
||||
step: 0.4, // 数值越大速度滚动越快
|
||||
limitMoveNum: 5, // 开始无缝滚动的数据量 this.dataList.length
|
||||
hoverStop: true, // 是否开启鼠标悬停stop
|
||||
direction: 1, // 0向下 1向上 2向左 3向右
|
||||
openWatch: true, // 开启数据实时监控刷新dom
|
||||
singleHeight: 0, // 单步运动停止的高度(默认值0是无缝不停止的滚动) direction => 0/1
|
||||
singleWidth: 0, // 单步运动停止的宽度(默认值0是无缝不停止的滚动) direction => 2/3
|
||||
waitTime: 1000 // 单步运动停止的时间(默认值1000ms)
|
||||
}
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this._homepageEquipment()
|
||||
this.refresh()
|
||||
},
|
||||
destroyed () {
|
||||
clearInterval(this.timer)
|
||||
},
|
||||
methods: {
|
||||
refresh () {
|
||||
this.timer = setInterval(() => {
|
||||
this._homepageEquipment()
|
||||
}, this.interTime)
|
||||
},
|
||||
async _homepageEquipment () {
|
||||
let res = await homepageEquipment()
|
||||
this.productReport = [...res.productReport]
|
||||
this.deviceReport = [...res.deviceReport]
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
@import '~@style/mixin'
|
||||
.left_wraper
|
||||
position relative
|
||||
_wh(100%, 100%)
|
||||
background center / 100% 100% url('../../../../images/bg-center_right.jpg') no-repeat
|
||||
.table_wraper_1
|
||||
position absolute
|
||||
top 678px
|
||||
right 408px
|
||||
_wh(358px, 195px)
|
||||
.table_wraper_2
|
||||
position absolute
|
||||
top 678px
|
||||
right 30px
|
||||
_wh(358px, 195px)
|
||||
.scroll_wrap
|
||||
_wh(100%, 100%)
|
||||
.scroll_title
|
||||
_wh(100%, 31px)
|
||||
background center / 100% 100% url('../../../../images/bg-title_3.png') no-repeat
|
||||
padding 8px 8px 0 39px
|
||||
p
|
||||
font-size 20px
|
||||
font-family: 'YouSheBiaoTiHei';
|
||||
font-style: italic;
|
||||
color: transparent;
|
||||
line-height 20px
|
||||
background: linear-gradient(0deg, #F9FEFF 0%, #F5FCFF 53.3154296875%, #BAE9FF 100%);
|
||||
-webkit-background-clip: text;
|
||||
background-clip: text;
|
||||
.scroll_container_1
|
||||
width 100%
|
||||
height calc(100% - 31px)
|
||||
overflow hidden
|
||||
.scroll-ul_1
|
||||
li
|
||||
_wh(100%, 40px)
|
||||
border-bottom 1px solid rgba(122,159,224,0.17)
|
||||
background-color rgba(31,46,73,0.9)
|
||||
opacity: 0.9
|
||||
.scroll-ul_1_div
|
||||
float left
|
||||
height 40px
|
||||
_fj(row, center)
|
||||
_font(16px, 16px, #B2BBD7,,center)
|
||||
font-family: 'SourceHanSansCN-Regular';
|
||||
font-style: italic;
|
||||
word-wrap break-word
|
||||
word-break break-all
|
||||
// white-space nowrap
|
||||
padding 0 5px
|
||||
overflow hidden
|
||||
&:nth-child(1)
|
||||
width 29%
|
||||
&:nth-child(2)
|
||||
width 51%
|
||||
&:nth-child(3)
|
||||
width 20%
|
||||
.state
|
||||
display block
|
||||
_wh(20px, 14px)
|
||||
.state_name
|
||||
width calc(100% - 20px)
|
||||
.scroll-ul_2
|
||||
li
|
||||
.scroll-ul_1_div
|
||||
&:nth-child(1)
|
||||
width 47%
|
||||
&:nth-child(2)
|
||||
width 30%
|
||||
&:nth-child(3)
|
||||
width 23%
|
||||
.state_0
|
||||
background center / 100% 100% url('../../../../images/state_0.png') no-repeat
|
||||
.state_1
|
||||
background center / 100% 100% url('../../../../images/state_1.png') no-repeat
|
||||
.state_2
|
||||
background center / 100% 100% url('../../../../images/state_2.png') no-repeat
|
||||
.state_3
|
||||
background center / 100% 100% url('../../../../images/state_3.png') no-repeat
|
||||
</style>
|
||||
1025
src/pages/modules/home/right/right.vue
Normal file
32
src/pages/modules/pinye.vue
Normal file
@@ -0,0 +1,32 @@
|
||||
<template>
|
||||
<div class="box">
|
||||
<div class="n_left_wraper">
|
||||
<left-page></left-page>
|
||||
</div>
|
||||
<div class="n_left_wraper">
|
||||
<right-page></right-page>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import leftPage from './home/left/index.vue'
|
||||
import rightPage from './home/right/index.vue'
|
||||
export default {
|
||||
components: {
|
||||
leftPage,
|
||||
rightPage
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
.box
|
||||
width 100%
|
||||
height 100%
|
||||
display: flex
|
||||
justify-content: space-between;
|
||||
.n_left_wraper
|
||||
width 50%
|
||||
height 100%
|
||||
</style>
|
||||
35
src/router/index.js
Normal file
@@ -0,0 +1,35 @@
|
||||
import Vue from 'vue'
|
||||
import Router from 'vue-router'
|
||||
|
||||
const Setup = r => require.ensure([], () => r(require('@page/Setup')), 'Setup')
|
||||
const lIndex = r => require.ensure([], () => r(require('@page/modules/home/left/index')), 'newscreen')
|
||||
const rIndex = r => require.ensure([], () => r(require('@page/modules/home/right/index')), 'newscreen')
|
||||
const pinye = r => require.ensure([], () => r(require('@page/modules/pinye')), 'pinye')
|
||||
|
||||
Vue.use(Router)
|
||||
|
||||
export default new Router({
|
||||
linkActiveClass: 'tab-active',
|
||||
routes: [
|
||||
{
|
||||
path: '/',
|
||||
redirect: '/setup'
|
||||
},
|
||||
{
|
||||
path: '/setup',
|
||||
component: Setup
|
||||
},
|
||||
{
|
||||
path: '/lindex',
|
||||
component: lIndex
|
||||
},
|
||||
{
|
||||
path: '/rindex',
|
||||
component: rIndex
|
||||
},
|
||||
{
|
||||
path: '/pinye',
|
||||
component: pinye
|
||||
}
|
||||
]
|
||||
})
|
||||
BIN
src/style/font/SourceHanSansCN-Bold.otf
Normal file
BIN
src/style/font/SourceHanSansCN-Medium.otf
Normal file
BIN
src/style/font/SourceHanSansCN-Regular.otf
Normal file
BIN
src/style/font/YouSheBiaoTiHei.ttf
Normal file
33
src/style/iconfont.styl
Normal file
@@ -0,0 +1,33 @@
|
||||
@font-face {
|
||||
font-family: "iconfont"; /* Project id 1255596 */
|
||||
src: url('iconfont/iconfont.woff2') format('woff2'),
|
||||
url('iconfont/iconfont.woff') format('woff'),
|
||||
url('iconfont/iconfont.ttf') format('truetype');
|
||||
}
|
||||
@font-face {
|
||||
font-family: "YouSheBiaoTiHei";
|
||||
src: url('font/YouSheBiaoTiHei.ttf') format('truetype');
|
||||
}
|
||||
@font-face {
|
||||
font-family: "SourceHanSansCN-Bold";
|
||||
src: url('font/SourceHanSansCN-Bold.otf') format('truetype');
|
||||
}
|
||||
@font-face {
|
||||
font-family: "SourceHanSansCN-Regular";
|
||||
src: url('font/SourceHanSansCN-Regular.otf') format('truetype');
|
||||
}
|
||||
@font-face {
|
||||
font-family: "SourceHanSansCN-Medium";
|
||||
src: url('font/SourceHanSansCN-Medium.otf') format('truetype');
|
||||
}
|
||||
.iconfont {
|
||||
font-family: "iconfont" !important;
|
||||
font-size: 16px;
|
||||
font-style: normal;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.icon-guanbi:before {
|
||||
content: "\e60f";
|
||||
}
|
||||
37
src/style/iconfont/iconfont.json
Normal file
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"id": "1255596",
|
||||
"name": "nl-hht-hl",
|
||||
"font_family": "iconfont",
|
||||
"css_prefix_text": "icon-",
|
||||
"description": "",
|
||||
"glyphs": [
|
||||
{
|
||||
"icon_id": "2229060",
|
||||
"name": "无信号",
|
||||
"font_class": "no-signal",
|
||||
"unicode": "e76b",
|
||||
"unicode_decimal": 59243
|
||||
},
|
||||
{
|
||||
"icon_id": "400034",
|
||||
"name": "下拉",
|
||||
"font_class": "htmal5icon03",
|
||||
"unicode": "e626",
|
||||
"unicode_decimal": 58918
|
||||
},
|
||||
{
|
||||
"icon_id": "731140",
|
||||
"name": "选择",
|
||||
"font_class": "guanbi1",
|
||||
"unicode": "e608",
|
||||
"unicode_decimal": 58888
|
||||
},
|
||||
{
|
||||
"icon_id": "4736203",
|
||||
"name": "关闭",
|
||||
"font_class": "guanbi",
|
||||
"unicode": "e60f",
|
||||
"unicode_decimal": 58895
|
||||
}
|
||||
]
|
||||
}
|
||||
BIN
src/style/iconfont/iconfont.ttf
Normal file
BIN
src/style/iconfont/iconfont.woff
Normal file
BIN
src/style/iconfont/iconfont.woff2
Normal file
11
src/style/layout.styl
Normal file
@@ -0,0 +1,11 @@
|
||||
@import 'mixin.styl'
|
||||
@import 'iconfont.styl'
|
||||
|
||||
.state_0
|
||||
background center / 100% 100% url('../images/state_0.png') no-repeat
|
||||
.state_1
|
||||
background center / 100% 100% url('../images/state_1.png') no-repeat
|
||||
.state_2
|
||||
background center / 100% 100% url('../images/state_2.png') no-repeat
|
||||
.state_3
|
||||
background center / 100% 100% url('../images/state_3.png') no-repeat
|
||||
48
src/style/mixin.styl
Normal file
@@ -0,0 +1,48 @@
|
||||
$green = #30EBC9
|
||||
$yellow = #E2BB0E
|
||||
$gray = #516282
|
||||
$gray1 = #8B90A6
|
||||
$orange = #F96700
|
||||
$green2 = #65d837
|
||||
|
||||
.green
|
||||
background-color #11ff0d
|
||||
.yellow
|
||||
background-color #fdfd0f
|
||||
.gray
|
||||
background-color #bfbfbf
|
||||
.gray1
|
||||
background-color #d8d1d1
|
||||
.red
|
||||
background-color #ff1016
|
||||
|
||||
//宽高
|
||||
_wh(w, h)
|
||||
width: w
|
||||
height: h
|
||||
|
||||
//字体大小、行高、颜色
|
||||
_font(size,height,color=#ffffff,weight=normal,align=center)
|
||||
font-size: size
|
||||
line-height: height
|
||||
color: color
|
||||
font-weight: weight
|
||||
text-align: align
|
||||
|
||||
// 背景图片地址和大小
|
||||
_bis(url,w=100%,h=100%,x=center,y=center,r=no-repeat)
|
||||
background-position: x y
|
||||
background-size: w h
|
||||
background-image: url(url)
|
||||
background-repeat: r
|
||||
|
||||
// 背景图片改变颜色
|
||||
_shadow(w,c)
|
||||
filter drop-shadow(w 0 0 c)
|
||||
|
||||
//flex 布局和 子元素 对其方式
|
||||
_fj(c=column, x=space-between,y=center)
|
||||
display: flex
|
||||
flex-direction: c
|
||||
justify-content: x
|
||||
align-items: y
|
||||
152
src/style/reset.css
Normal file
@@ -0,0 +1,152 @@
|
||||
html, body, div, span, applet, object, iframe,
|
||||
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
|
||||
a, abbr, acronym, address, big, cite, code,
|
||||
del, dfn, em, img, ins, kbd, q, s, samp,
|
||||
small, strike, strong, sub, sup, tt, var,
|
||||
b, u, i, center,
|
||||
dl, dt, dd, ol, ul, li,
|
||||
fieldset, form, label, legend,
|
||||
table, caption, tbody, tfoot, thead, tr, th, td,
|
||||
article, aside, canvas, details, embed,
|
||||
figure, figcaption, footer, header,
|
||||
menu, nav, output, ruby, section, summary,
|
||||
time, mark, audio, video, input {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
/* HTML5 display-role reset for older browsers */
|
||||
article, aside, details, figcaption, figure,
|
||||
footer, header, menu, nav, section {
|
||||
display: block;
|
||||
}
|
||||
|
||||
blockquote, q {
|
||||
quotes: none;
|
||||
}
|
||||
|
||||
blockquote:before, blockquote:after,
|
||||
q:before, q:after {
|
||||
content: none;
|
||||
}
|
||||
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
border-spacing: 0;
|
||||
}
|
||||
|
||||
/* custom */
|
||||
a,a:link,a:visited,a:active {
|
||||
text-decoration: none;
|
||||
-webkit-backface-visibility: hidden;
|
||||
}
|
||||
|
||||
li {
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar {
|
||||
width: 5px;
|
||||
height: 5px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-track-piece {
|
||||
background-color: rgba(0, 0, 0, 0.2);
|
||||
-webkit-border-radius: 6px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb:vertical {
|
||||
height: 5px;
|
||||
background-color: rgba(125, 125, 125, 0.7);
|
||||
-webkit-border-radius: 6px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb:horizontal {
|
||||
width: 5px;
|
||||
background-color: rgba(125, 125, 125, 0.7);
|
||||
-webkit-border-radius: 6px;
|
||||
}
|
||||
|
||||
html, body {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
width: 1920px;
|
||||
height: 1200px;
|
||||
}
|
||||
|
||||
body {
|
||||
-webkit-text-size-adjust: none;
|
||||
-webkit-tap-highlight-color: rgba(11, 7, 7, 0);
|
||||
-moz-user-select:none;/*火狐*/
|
||||
-webkit-user-select:none;/*webkit浏览器*/
|
||||
-ms-user-select:none;/*IE10*/
|
||||
-khtml-user-select:none;/*早期浏览器*/
|
||||
user-select:none;
|
||||
background-color: #050830;
|
||||
}
|
||||
|
||||
div, p {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.clearfix {
|
||||
zoom: 1;
|
||||
}
|
||||
|
||||
.clearfix:after {
|
||||
content: "";
|
||||
display: table;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.ellipsis {
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.fl {
|
||||
float: left !important;
|
||||
}
|
||||
|
||||
.fr {
|
||||
float: right !important;
|
||||
}
|
||||
|
||||
.hide {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.fontselect {
|
||||
-moz-user-select:none;/*火狐*/
|
||||
-webkit-user-select:none;/*webkit浏览器*/
|
||||
-ms-user-select:none;/*IE10*/
|
||||
-khtml-user-select:none;/*早期浏览器*/
|
||||
user-select:none;
|
||||
}
|
||||
|
||||
.flexcenter {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.flexbetween {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.pointer {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.hidden {
|
||||
visibility: hidden
|
||||
}
|
||||
|
||||
.relative {
|
||||
position: relative
|
||||
}
|
||||
43
src/vuex/modules/com.js
Normal file
@@ -0,0 +1,43 @@
|
||||
import * as types from '../types'
|
||||
import { getStore, setStore } from '@js/mUtils.js'
|
||||
|
||||
const baseUrl = process.env.NODE_ENV === 'development' ? 'http://192.168.81.59:8080' : 'http://192.168.46.5:8080/hl_nlapp'
|
||||
|
||||
/**
|
||||
* App通用配置
|
||||
*/
|
||||
const state = {
|
||||
baseUrl: getStore('baseUrl') || baseUrl,
|
||||
setTime: getStore('setTime') || 5000,
|
||||
equipId: getStore('equipId') || '1'
|
||||
}
|
||||
|
||||
const actions = {
|
||||
setConfig ({commit}, res) {
|
||||
setStore('baseUrl', res.baseUrl)
|
||||
setStore('setTime', res.setTime)
|
||||
setStore('equipId', res.equipId)
|
||||
commit(types.COM_CONFIG, res)
|
||||
}
|
||||
}
|
||||
|
||||
const getters = {
|
||||
baseUrl: state => state.baseUrl,
|
||||
setTime: state => state.setTime,
|
||||
equipId: state => state.equipId
|
||||
}
|
||||
|
||||
const mutations = {
|
||||
[types.COM_CONFIG] (state, res) {
|
||||
state.baseUrl = res.baseUrl
|
||||
state.setTime = res.setTime
|
||||
state.equipId = res.equipId
|
||||
}
|
||||
}
|
||||
|
||||
export default {
|
||||
state,
|
||||
actions,
|
||||
getters,
|
||||
mutations
|
||||
}
|
||||