map
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 * 1080
|
||||
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>
|
||||
12049
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>
|
||||
46
src/components/flowsvg.vue
Normal file
@@ -0,0 +1,46 @@
|
||||
<template>
|
||||
<div class="svg_wraper dashRight">
|
||||
<svg width="100%" height="100%">
|
||||
<linearGradient id="linear" x1="0%" y1="0%" x2="100%" y2="0%">
|
||||
<stop stop-color="#ffe505"/>
|
||||
</linearGradient>
|
||||
<path :class="direction" d="M 0 7 L 1862 7" stroke="rgba(0, 206, 208, .7)" style="stroke-dasharray: 20, 8;stroke-width: 4;" />
|
||||
</svg>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
direction: String
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
.svg_wraper
|
||||
width calc(100% - 20px)
|
||||
height 16px
|
||||
margin 0 auto
|
||||
// border-top 2px solid rgba(0, 206, 208, .7)
|
||||
// border-bottom 2px solid rgba(0, 206, 208, .7)
|
||||
background-color rgba(0, 206, 208, .3)
|
||||
// background-color: #02344d;
|
||||
// border: 2px solid #186189;
|
||||
@keyframes dashLeft {
|
||||
to {
|
||||
stroke-dashoffset: 100;
|
||||
}
|
||||
}
|
||||
@keyframes dashRight {
|
||||
to {
|
||||
stroke-dashoffset: -100;
|
||||
}
|
||||
}
|
||||
.pathLeft {
|
||||
animation: dashLeft 1s linear infinite;
|
||||
}
|
||||
.pathRight {
|
||||
animation: dashRight 1s linear infinite;
|
||||
}
|
||||
</style>
|
||||
125
src/components/header.vue
Normal file
@@ -0,0 +1,125 @@
|
||||
<template>
|
||||
<header>
|
||||
<div class="exit_btn iconfont" @click.stop="$router.push('/setup')"></div>
|
||||
<p>{{title}}</p>
|
||||
<div class="data_box clearfix">
|
||||
<div class="date_item date">{{date}}</div>
|
||||
<div class="date_item week">{{week}}</div>
|
||||
<div class="date_item clearfix">
|
||||
<div class="tiem_item hours">{{hours}}</div>
|
||||
<div class="colon">:</div>
|
||||
<div class="tiem_item minutes">{{minutes}}</div>
|
||||
<div class="colon">:</div>
|
||||
<div class="tiem_item seconds">{{seconds}}</div>
|
||||
</div>
|
||||
</div>
|
||||
<slot></slot>
|
||||
</header>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'Header',
|
||||
data () {
|
||||
return {
|
||||
expand: false,
|
||||
timer: null,
|
||||
time: '',
|
||||
hours: '',
|
||||
minutes: '',
|
||||
seconds: '',
|
||||
date: '',
|
||||
week: ''
|
||||
}
|
||||
},
|
||||
props: {
|
||||
title: String
|
||||
},
|
||||
created () {
|
||||
this.updateTime()
|
||||
this.timer = window.setInterval(this.updateTime, 1000)
|
||||
},
|
||||
beforeDestroy () {
|
||||
this.$once('hook:beforeDestroy', () => {
|
||||
clearInterval(this.timer)
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
expandTooltip () {
|
||||
this.expand = !this.expand
|
||||
},
|
||||
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.hours = `${hh}`
|
||||
this.minutes = `${mm}`
|
||||
this.seconds = `${ss}`
|
||||
this.date = `${year}年${month}月${date}日`
|
||||
this.week = `${week}`
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
.exit_btn
|
||||
position absolute
|
||||
left 25px
|
||||
top 14px
|
||||
height 37px
|
||||
width 37px
|
||||
line-height 37px
|
||||
font-size 20px
|
||||
color #fff
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
border-radius: 50%;
|
||||
header
|
||||
position relative
|
||||
width 100%
|
||||
height 8%
|
||||
position relative
|
||||
background center center / 100% 100% url(../images/screen1/header.png) no-repeat
|
||||
p
|
||||
// font-family "PangMenZhengDao"
|
||||
font-family "YouSheBiaoTiHei"
|
||||
font-size 50px
|
||||
line-height 88px
|
||||
color #fff
|
||||
font-weight lighter
|
||||
text-align center
|
||||
letter-spacing 5px
|
||||
padding-left 5px
|
||||
text-shadow 0 8px 8px rgba(0,0,0,0.30)
|
||||
.data_box
|
||||
position absolute
|
||||
right 25px
|
||||
top 14px
|
||||
height 37px
|
||||
.date, .week
|
||||
padding-right 20px
|
||||
.date_item
|
||||
float left
|
||||
font-size 20px
|
||||
line-height 37px
|
||||
color #fff
|
||||
.tiem_item
|
||||
float left
|
||||
font-size 20px
|
||||
line-height 37px
|
||||
color #fff
|
||||
.colon
|
||||
float left
|
||||
font-size 20px
|
||||
line-height 37px
|
||||
color #fff
|
||||
</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 15px
|
||||
top 30px
|
||||
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
|
||||
7
src/config/getData1.js
Normal file
@@ -0,0 +1,7 @@
|
||||
import {post} from '@js/http.js'
|
||||
|
||||
/** 压制看板 */
|
||||
export const cockpitpress = (id) => post('api/cockpit/press', {})
|
||||
|
||||
/** 分拣作业监控 */
|
||||
export const cockpitsorting = (id) => post('api/cockpit/sorting', {})
|
||||
13
src/config/getData2.js
Normal file
@@ -0,0 +1,13 @@
|
||||
import {post, post1} from './http.js'
|
||||
// 大屏-中间设备运行情况
|
||||
export const deviceCondition = () => post('api/cockpit/deviceCondition', {})
|
||||
// 出、入窑输送线弹窗
|
||||
export const inOutKilnDetail = () => post('api/cockpit/inOutKilnDetail', {})
|
||||
// 窑弹出框
|
||||
export const kilnDetail = () => post('api/cockpit/kilnDetail', {})
|
||||
// 大屏-两侧图表
|
||||
export const screenTableData = () => post('api/cockpit/screenTableData', {})
|
||||
// 窑看板
|
||||
export const klineInfo = () => post('api/cockpit/klineInfo', {})
|
||||
// 料仓监控
|
||||
export const queryliaocang = () => post1('api/hand/queryliaocang', {})
|
||||
80
src/config/http.js
Normal file
@@ -0,0 +1,80 @@
|
||||
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)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
export const post1 = (sevmethod, params) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
axios.post(`${store.getters.lcUrl}/` + 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
|
||||
}
|
||||
264
src/config/mork01.js
Normal file
750
src/config/mork1.js
Normal file
@@ -0,0 +1,750 @@
|
||||
/** 压制看板 */
|
||||
export const cockpitpress = () => {
|
||||
let res = {
|
||||
'PressOrderList': [
|
||||
{
|
||||
'planQty': '4000',
|
||||
'realQty': '2016',
|
||||
'rate': '0.50',
|
||||
'orderNumber': 'SY202403-04'
|
||||
},
|
||||
{
|
||||
'planQty': '2000',
|
||||
'realQty': '2772',
|
||||
'rate': '1.39',
|
||||
'orderNumber': 'sy02403-04'
|
||||
},
|
||||
{
|
||||
'planQty': '2000',
|
||||
'realQty': '1512',
|
||||
'rate': '0.76',
|
||||
'orderNumber': 'SY202401-02'
|
||||
}
|
||||
],
|
||||
'ProductionTask': [
|
||||
{
|
||||
'device': '压机02',
|
||||
'workorderCode': '240317013',
|
||||
'team': '白班',
|
||||
'materialName': 'ML-75B',
|
||||
'customer': '实业股份',
|
||||
'planproducestartDate': '2024-03-17 15:45:44',
|
||||
'planQty': '1000',
|
||||
'realQty': '1764',
|
||||
'unqualifiedQty': null,
|
||||
'qualifiedRate': null,
|
||||
'workorderStatus': '生产中',
|
||||
'operator': '管理员',
|
||||
'realproducestartDate': '2024-03-17 15:45:42',
|
||||
'realproduceendDate': '-'
|
||||
},
|
||||
{
|
||||
'device': '压机05',
|
||||
'workorderCode': '240325003',
|
||||
'team': '白班',
|
||||
'materialName': 'ML-70BD',
|
||||
'customer': '实业股份',
|
||||
'planproducestartDate': '2024-03-25 09:17:07',
|
||||
'planQty': '1000',
|
||||
'realQty': '1764',
|
||||
'unqualifiedQty': null,
|
||||
'qualifiedRate': null,
|
||||
'workorderStatus': '生产中',
|
||||
'operator': '管理员',
|
||||
'realproducestartDate': '2024-03-25 09:17:14',
|
||||
'realproduceendDate': '-'
|
||||
},
|
||||
{
|
||||
'device': '压机07',
|
||||
'workorderCode': '240325005',
|
||||
'team': '白班',
|
||||
'materialName': 'BP-70A',
|
||||
'customer': '实业股份',
|
||||
'planproducestartDate': '2024-03-25 09:25:23',
|
||||
'planQty': '1000',
|
||||
'realQty': '756',
|
||||
'unqualifiedQty': null,
|
||||
'qualifiedRate': null,
|
||||
'workorderStatus': '生产中',
|
||||
'operator': '管理员',
|
||||
'realproducestartDate': '2024-03-25 09:25:27',
|
||||
'realproduceendDate': '-'
|
||||
},
|
||||
{
|
||||
'device': '压机08',
|
||||
'workorderCode': '240325006',
|
||||
'team': '白班',
|
||||
'materialName': 'BP-65A',
|
||||
'customer': '实业股份',
|
||||
'planproducestartDate': '2024-03-25 09:26:39',
|
||||
'planQty': '1000',
|
||||
'realQty': '756',
|
||||
'unqualifiedQty': null,
|
||||
'qualifiedRate': null,
|
||||
'workorderStatus': '生产中',
|
||||
'operator': '管理员',
|
||||
'realproducestartDate': '2024-03-25 09:26:35',
|
||||
'realproduceendDate': '-'
|
||||
},
|
||||
{
|
||||
'device': '压机01',
|
||||
'workorderCode': '240329002',
|
||||
'team': '白班',
|
||||
'materialName': 'ML-70BD',
|
||||
'customer': '沙湾',
|
||||
'planproducestartDate': '2024-03-29 10:24:01',
|
||||
'planQty': '1000',
|
||||
'realQty': '1008',
|
||||
'unqualifiedQty': null,
|
||||
'qualifiedRate': null,
|
||||
'workorderStatus': '生产中',
|
||||
'operator': '管理员',
|
||||
'realproducestartDate': '2024-03-29 10:24:26',
|
||||
'realproduceendDate': '-'
|
||||
},
|
||||
{
|
||||
'device': '压机06',
|
||||
'workorderCode': '240330001',
|
||||
'team': '白班',
|
||||
'materialName': 'ML-75B',
|
||||
'customer': '镍业',
|
||||
'planproducestartDate': '2024-03-30 11:39:29',
|
||||
'planQty': '1000',
|
||||
'realQty': '252',
|
||||
'unqualifiedQty': null,
|
||||
'qualifiedRate': null,
|
||||
'workorderStatus': '生产中',
|
||||
'operator': '管理员',
|
||||
'realproducestartDate': '2024-03-30 11:39:37',
|
||||
'realproduceendDate': '-'
|
||||
},
|
||||
{
|
||||
'device': '压机04',
|
||||
'workorderCode': '240330005',
|
||||
'team': '白班',
|
||||
'materialName': 'ML-75B',
|
||||
'customer': '镍业',
|
||||
'planproducestartDate': '2024-03-30 12:34:12',
|
||||
'planQty': '1000',
|
||||
'realQty': '0',
|
||||
'unqualifiedQty': null,
|
||||
'qualifiedRate': null,
|
||||
'workorderStatus': '生产中',
|
||||
'operator': '管理员',
|
||||
'realproducestartDate': '2024-03-30 12:34:09',
|
||||
'realproduceendDate': '-'
|
||||
},
|
||||
{
|
||||
'device': '压机03',
|
||||
'workorderCode': '240401001',
|
||||
'team': '白班',
|
||||
'materialName': 'ML-75B',
|
||||
'customer': '镍业',
|
||||
'planproducestartDate': '2024-04-01 11:07:51',
|
||||
'planQty': '1000',
|
||||
'realQty': '0',
|
||||
'unqualifiedQty': null,
|
||||
'qualifiedRate': null,
|
||||
'workorderStatus': '生产中',
|
||||
'operator': '管理员',
|
||||
'realproducestartDate': '2024-04-01 11:08:07',
|
||||
'realproduceendDate': '-'
|
||||
}
|
||||
],
|
||||
'DayShiftInfo': [
|
||||
{
|
||||
'planQty': '8000',
|
||||
'realQty': '6300',
|
||||
'unqualifiedQty': '974',
|
||||
'qualifiedQty': '5564',
|
||||
'team': '白班'
|
||||
}
|
||||
],
|
||||
'ShiftProductionList': [
|
||||
{
|
||||
'columnName': '压机01',
|
||||
'qualifiedQty': '600',
|
||||
'unqualifiedQty': '77',
|
||||
'lastQty': '323',
|
||||
'workOrderCode': '240329002',
|
||||
'pointCode': 'YJ01',
|
||||
'planQty': '1000',
|
||||
'qualifyRate': '0.60'
|
||||
},
|
||||
{
|
||||
'columnName': '压机02',
|
||||
'qualifiedQty': '0',
|
||||
'unqualifiedQty': '0',
|
||||
'lastQty': '1000',
|
||||
'workOrderCode': '240317013',
|
||||
'pointCode': 'YJ02',
|
||||
'planQty': '1000',
|
||||
'qualifyRate': '0.00'
|
||||
},
|
||||
{
|
||||
'columnName': '压机03',
|
||||
'qualifiedQty': '60',
|
||||
'unqualifiedQty': '21',
|
||||
'lastQty': '919',
|
||||
'workOrderCode': '240401001',
|
||||
'pointCode': 'YJ03',
|
||||
'planQty': '1000',
|
||||
'qualifyRate': '0.06'
|
||||
},
|
||||
{
|
||||
'columnName': '压机04',
|
||||
'qualifiedQty': '0',
|
||||
'unqualifiedQty': '0',
|
||||
'lastQty': '1000',
|
||||
'workOrderCode': '240330005',
|
||||
'pointCode': 'YJ04',
|
||||
'planQty': '1000',
|
||||
'qualifyRate': '0.00'
|
||||
},
|
||||
{
|
||||
'columnName': '压机05',
|
||||
'qualifiedQty': '1980',
|
||||
'unqualifiedQty': '226',
|
||||
'lastQty': '0',
|
||||
'workOrderCode': '240325003',
|
||||
'pointCode': 'YJ05',
|
||||
'planQty': '1000',
|
||||
'qualifyRate': '1.98'
|
||||
},
|
||||
{
|
||||
'columnName': '压机06',
|
||||
'qualifiedQty': '0',
|
||||
'unqualifiedQty': '0',
|
||||
'lastQty': '1000',
|
||||
'workOrderCode': '240330001',
|
||||
'pointCode': 'YJ06',
|
||||
'planQty': '1000',
|
||||
'qualifyRate': '0.00'
|
||||
},
|
||||
{
|
||||
'columnName': '压机07',
|
||||
'qualifiedQty': '1160',
|
||||
'unqualifiedQty': '422',
|
||||
'lastQty': '0',
|
||||
'workOrderCode': '240325005',
|
||||
'pointCode': 'YJ07',
|
||||
'planQty': '1000',
|
||||
'qualifyRate': '1.16'
|
||||
},
|
||||
{
|
||||
'columnName': '压机08',
|
||||
'qualifiedQty': '1764',
|
||||
'unqualifiedQty': '228',
|
||||
'lastQty': '0',
|
||||
'workOrderCode': '240325006',
|
||||
'pointCode': 'YJ08',
|
||||
'planQty': '1000',
|
||||
'qualifyRate': '1.76'
|
||||
}
|
||||
]
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
/** 分拣作业监控 */
|
||||
export const cockpitsorting = () => {
|
||||
let res = {
|
||||
'stackingList': [
|
||||
{
|
||||
'materialQty': '252',
|
||||
'materialModel': '20/10',
|
||||
'materialCode': 'ML-70BD',
|
||||
'createTime': '03-29 10:00:50'
|
||||
},
|
||||
{
|
||||
'materialQty': '252',
|
||||
'materialModel': '20/10',
|
||||
'materialCode': 'ML-70BD',
|
||||
'createTime': '03-29 08:33:22'
|
||||
},
|
||||
{
|
||||
'materialQty': '252',
|
||||
'materialModel': '20/10',
|
||||
'materialCode': 'ML-70BD',
|
||||
'createTime': '03-29 08:20:41'
|
||||
},
|
||||
{
|
||||
'materialQty': '252',
|
||||
'materialModel': '20/10',
|
||||
'materialCode': 'ML-70BD',
|
||||
'createTime': '03-28 13:30:49'
|
||||
},
|
||||
{
|
||||
'materialQty': '252',
|
||||
'materialModel': '20/10',
|
||||
'materialCode': 'ML-70BD',
|
||||
'createTime': '03-28 13:00:22'
|
||||
},
|
||||
{
|
||||
'materialQty': '252',
|
||||
'materialModel': '20/10',
|
||||
'materialCode': 'ML-70BD',
|
||||
'createTime': '03-28 10:37:02'
|
||||
},
|
||||
{
|
||||
'materialQty': '252',
|
||||
'materialModel': '20/10',
|
||||
'materialCode': 'ML-70BD',
|
||||
'createTime': '03-28 10:35:57'
|
||||
},
|
||||
{
|
||||
'materialQty': '252',
|
||||
'materialModel': '20/30',
|
||||
'materialCode': 'ML-70BD',
|
||||
'createTime': '03-28 08:43:04'
|
||||
},
|
||||
{
|
||||
'materialQty': '252',
|
||||
'materialModel': '20/30',
|
||||
'materialCode': 'ML-70BD',
|
||||
'createTime': '03-28 08:39:43'
|
||||
},
|
||||
{
|
||||
'materialQty': '252',
|
||||
'materialModel': '18/10',
|
||||
'materialCode': 'ML-60BT',
|
||||
'createTime': '03-16 17:13:26'
|
||||
},
|
||||
{
|
||||
'materialQty': '252',
|
||||
'materialModel': '18/30',
|
||||
'materialCode': 'ML-60BT',
|
||||
'createTime': '03-16 15:08:38'
|
||||
},
|
||||
{
|
||||
'materialQty': '252',
|
||||
'materialModel': '18/30',
|
||||
'materialCode': 'ML-60BT',
|
||||
'createTime': '03-16 14:54:16'
|
||||
},
|
||||
{
|
||||
'materialQty': '126',
|
||||
'materialModel': '40/0',
|
||||
'materialCode': 'AP-70A',
|
||||
'createTime': '03-16 13:20:19'
|
||||
},
|
||||
{
|
||||
'materialQty': '126',
|
||||
'materialModel': '40/0',
|
||||
'materialCode': 'AP-70A',
|
||||
'createTime': '03-16 11:28:38'
|
||||
},
|
||||
{
|
||||
'materialQty': '126',
|
||||
'materialModel': '40/0',
|
||||
'materialCode': 'AP-70A',
|
||||
'createTime': '03-16 10:35:55'
|
||||
},
|
||||
{
|
||||
'materialQty': '126',
|
||||
'materialModel': '40/0',
|
||||
'materialCode': 'AP-70A',
|
||||
'createTime': '03-16 09:13:43'
|
||||
},
|
||||
{
|
||||
'materialQty': '126',
|
||||
'materialModel': '40/0',
|
||||
'materialCode': 'AP-70A',
|
||||
'createTime': '03-16 09:05:29'
|
||||
},
|
||||
{
|
||||
'materialQty': '252',
|
||||
'materialModel': '18/10',
|
||||
'materialCode': 'ML-60BT',
|
||||
'createTime': '03-15 15:48:21'
|
||||
},
|
||||
{
|
||||
'materialQty': '252',
|
||||
'materialModel': '18/10',
|
||||
'materialCode': 'ML-60BT',
|
||||
'createTime': '03-15 15:17:40'
|
||||
},
|
||||
{
|
||||
'materialQty': '252',
|
||||
'materialModel': '18/10',
|
||||
'materialCode': 'ML-60BT',
|
||||
'createTime': '03-15 14:27:23'
|
||||
},
|
||||
{
|
||||
'materialQty': '252',
|
||||
'materialModel': '20/10',
|
||||
'materialCode': 'ML-60BT',
|
||||
'createTime': '03-15 13:23:13'
|
||||
},
|
||||
{
|
||||
'materialQty': '252',
|
||||
'materialModel': '20/10',
|
||||
'materialCode': 'ML-60BT',
|
||||
'createTime': '03-15 13:11:03'
|
||||
},
|
||||
{
|
||||
'materialQty': '252',
|
||||
'materialModel': '20/10',
|
||||
'materialCode': 'ML-60BT',
|
||||
'createTime': '03-15 11:06:05'
|
||||
},
|
||||
{
|
||||
'materialQty': '252',
|
||||
'materialModel': '20/30',
|
||||
'materialCode': 'ML-60BT',
|
||||
'createTime': '03-15 08:50:52'
|
||||
},
|
||||
{
|
||||
'materialQty': '252',
|
||||
'materialModel': '20/30',
|
||||
'materialCode': 'ML-60BT',
|
||||
'createTime': '03-15 08:15:38'
|
||||
},
|
||||
{
|
||||
'materialQty': '0',
|
||||
'materialModel': '20/30',
|
||||
'materialCode': 'ML-60BT',
|
||||
'createTime': '03-15 08:03:13'
|
||||
},
|
||||
{
|
||||
'materialQty': '0',
|
||||
'materialModel': '20/30',
|
||||
'materialCode': 'MT-14AT',
|
||||
'createTime': '01-20 16:22:03'
|
||||
},
|
||||
{
|
||||
'materialQty': '252',
|
||||
'materialModel': '20/30',
|
||||
'materialCode': 'MT-14AT',
|
||||
'createTime': '01-20 15:27:45'
|
||||
},
|
||||
{
|
||||
'materialQty': '126',
|
||||
'materialModel': '20/30',
|
||||
'materialCode': 'MT-14AT',
|
||||
'createTime': '01-20 14:47:00'
|
||||
},
|
||||
{
|
||||
'materialQty': '0',
|
||||
'materialModel': '20/30',
|
||||
'materialCode': 'MT-14AT',
|
||||
'createTime': '01-20 13:46:11'
|
||||
},
|
||||
{
|
||||
'materialQty': '0',
|
||||
'materialModel': '20/30',
|
||||
'materialCode': 'MT-14AT',
|
||||
'createTime': '01-20 12:28:36'
|
||||
},
|
||||
{
|
||||
'materialQty': '0',
|
||||
'materialModel': '20/30',
|
||||
'materialCode': 'MT-14AT',
|
||||
'createTime': '01-20 11:12:05'
|
||||
},
|
||||
{
|
||||
'materialQty': '0',
|
||||
'materialModel': '20/30',
|
||||
'materialCode': 'MT-14AT',
|
||||
'createTime': '01-20 10:53:27'
|
||||
},
|
||||
{
|
||||
'materialQty': '0',
|
||||
'materialModel': '20/30',
|
||||
'materialCode': 'MT-14AT',
|
||||
'createTime': '01-20 10:08:29'
|
||||
},
|
||||
{
|
||||
'materialQty': '0',
|
||||
'materialModel': '20/30',
|
||||
'materialCode': 'MT-14AT',
|
||||
'createTime': '01-20 09:23:01'
|
||||
},
|
||||
{
|
||||
'materialQty': '0',
|
||||
'materialModel': '20/30',
|
||||
'materialCode': 'MT-14AT',
|
||||
'createTime': '01-20 09:00:53'
|
||||
},
|
||||
{
|
||||
'materialQty': '252',
|
||||
'materialModel': null,
|
||||
'materialCode': null,
|
||||
'createTime': '01-14 13:23:47'
|
||||
}
|
||||
],
|
||||
'sortingLine': {
|
||||
'sortingLines': [
|
||||
{
|
||||
'workorderCode': '240329001',
|
||||
'pointName': '分拣拆垛机械手01',
|
||||
'customer': '沙湾',
|
||||
'materialName': 'ML-70BD',
|
||||
'materialSpec': 'BB',
|
||||
'planQty': '1000',
|
||||
'realQty': '0'
|
||||
}
|
||||
],
|
||||
'rgSortingLine': [],
|
||||
'rgPlanQty': '0',
|
||||
'rgRealQty': '0'
|
||||
},
|
||||
'unstackingList': [
|
||||
{
|
||||
'materialQty': '252',
|
||||
'materialModel': '20/10',
|
||||
'materialCode': 'ML-70BD',
|
||||
'createTime': '03-29 10:00:50'
|
||||
},
|
||||
{
|
||||
'materialQty': '252',
|
||||
'materialModel': '20/10',
|
||||
'materialCode': 'ML-70BD',
|
||||
'createTime': '03-29 08:33:22'
|
||||
},
|
||||
{
|
||||
'materialQty': '252',
|
||||
'materialModel': '20/10',
|
||||
'materialCode': 'ML-70BD',
|
||||
'createTime': '03-29 08:20:41'
|
||||
},
|
||||
{
|
||||
'materialQty': '252',
|
||||
'materialModel': '20/10',
|
||||
'materialCode': 'ML-70BD',
|
||||
'createTime': '03-28 13:30:49'
|
||||
},
|
||||
{
|
||||
'materialQty': '252',
|
||||
'materialModel': '20/10',
|
||||
'materialCode': 'ML-70BD',
|
||||
'createTime': '03-28 13:00:22'
|
||||
},
|
||||
{
|
||||
'materialQty': '252',
|
||||
'materialModel': '20/10',
|
||||
'materialCode': 'ML-70BD',
|
||||
'createTime': '03-28 10:37:02'
|
||||
},
|
||||
{
|
||||
'materialQty': '252',
|
||||
'materialModel': '20/10',
|
||||
'materialCode': 'ML-70BD',
|
||||
'createTime': '03-28 10:35:57'
|
||||
},
|
||||
{
|
||||
'materialQty': '252',
|
||||
'materialModel': '20/30',
|
||||
'materialCode': 'ML-70BD',
|
||||
'createTime': '03-28 08:43:04'
|
||||
},
|
||||
{
|
||||
'materialQty': '252',
|
||||
'materialModel': '20/30',
|
||||
'materialCode': 'ML-70BD',
|
||||
'createTime': '03-28 08:39:43'
|
||||
},
|
||||
{
|
||||
'materialQty': '252',
|
||||
'materialModel': '18/10',
|
||||
'materialCode': 'ML-60BT',
|
||||
'createTime': '03-16 17:13:26'
|
||||
},
|
||||
{
|
||||
'materialQty': '252',
|
||||
'materialModel': '18/30',
|
||||
'materialCode': 'ML-60BT',
|
||||
'createTime': '03-16 15:08:38'
|
||||
},
|
||||
{
|
||||
'materialQty': '252',
|
||||
'materialModel': '18/30',
|
||||
'materialCode': 'ML-60BT',
|
||||
'createTime': '03-16 14:54:16'
|
||||
},
|
||||
{
|
||||
'materialQty': '126',
|
||||
'materialModel': '40/0',
|
||||
'materialCode': 'AP-70A',
|
||||
'createTime': '03-16 13:20:19'
|
||||
},
|
||||
{
|
||||
'materialQty': '126',
|
||||
'materialModel': '40/0',
|
||||
'materialCode': 'AP-70A',
|
||||
'createTime': '03-16 11:28:38'
|
||||
},
|
||||
{
|
||||
'materialQty': '126',
|
||||
'materialModel': '40/0',
|
||||
'materialCode': 'AP-70A',
|
||||
'createTime': '03-16 10:35:55'
|
||||
},
|
||||
{
|
||||
'materialQty': '126',
|
||||
'materialModel': '40/0',
|
||||
'materialCode': 'AP-70A',
|
||||
'createTime': '03-16 09:13:43'
|
||||
},
|
||||
{
|
||||
'materialQty': '126',
|
||||
'materialModel': '40/0',
|
||||
'materialCode': 'AP-70A',
|
||||
'createTime': '03-16 09:05:29'
|
||||
},
|
||||
{
|
||||
'materialQty': '252',
|
||||
'materialModel': '18/10',
|
||||
'materialCode': 'ML-60BT',
|
||||
'createTime': '03-15 15:48:21'
|
||||
},
|
||||
{
|
||||
'materialQty': '252',
|
||||
'materialModel': '18/10',
|
||||
'materialCode': 'ML-60BT',
|
||||
'createTime': '03-15 15:17:40'
|
||||
},
|
||||
{
|
||||
'materialQty': '252',
|
||||
'materialModel': '18/10',
|
||||
'materialCode': 'ML-60BT',
|
||||
'createTime': '03-15 14:27:23'
|
||||
},
|
||||
{
|
||||
'materialQty': '252',
|
||||
'materialModel': '20/10',
|
||||
'materialCode': 'ML-60BT',
|
||||
'createTime': '03-15 13:23:13'
|
||||
},
|
||||
{
|
||||
'materialQty': '252',
|
||||
'materialModel': '20/10',
|
||||
'materialCode': 'ML-60BT',
|
||||
'createTime': '03-15 13:11:03'
|
||||
},
|
||||
{
|
||||
'materialQty': '252',
|
||||
'materialModel': '20/10',
|
||||
'materialCode': 'ML-60BT',
|
||||
'createTime': '03-15 11:06:05'
|
||||
},
|
||||
{
|
||||
'materialQty': '252',
|
||||
'materialModel': '20/30',
|
||||
'materialCode': 'ML-60BT',
|
||||
'createTime': '03-15 08:50:52'
|
||||
},
|
||||
{
|
||||
'materialQty': '252',
|
||||
'materialModel': '20/30',
|
||||
'materialCode': 'ML-60BT',
|
||||
'createTime': '03-15 08:15:38'
|
||||
},
|
||||
{
|
||||
'materialQty': '0',
|
||||
'materialModel': '20/30',
|
||||
'materialCode': 'ML-60BT',
|
||||
'createTime': '03-15 08:03:13'
|
||||
},
|
||||
{
|
||||
'materialQty': '0',
|
||||
'materialModel': '20/30',
|
||||
'materialCode': 'MT-14AT',
|
||||
'createTime': '01-20 16:22:03'
|
||||
},
|
||||
{
|
||||
'materialQty': '252',
|
||||
'materialModel': '20/30',
|
||||
'materialCode': 'MT-14AT',
|
||||
'createTime': '01-20 15:27:45'
|
||||
},
|
||||
{
|
||||
'materialQty': '126',
|
||||
'materialModel': '20/30',
|
||||
'materialCode': 'MT-14AT',
|
||||
'createTime': '01-20 14:47:00'
|
||||
},
|
||||
{
|
||||
'materialQty': '0',
|
||||
'materialModel': '20/30',
|
||||
'materialCode': 'MT-14AT',
|
||||
'createTime': '01-20 13:46:11'
|
||||
},
|
||||
{
|
||||
'materialQty': '0',
|
||||
'materialModel': '20/30',
|
||||
'materialCode': 'MT-14AT',
|
||||
'createTime': '01-20 12:28:36'
|
||||
},
|
||||
{
|
||||
'materialQty': '0',
|
||||
'materialModel': '20/30',
|
||||
'materialCode': 'MT-14AT',
|
||||
'createTime': '01-20 11:12:05'
|
||||
},
|
||||
{
|
||||
'materialQty': '0',
|
||||
'materialModel': '20/30',
|
||||
'materialCode': 'MT-14AT',
|
||||
'createTime': '01-20 10:53:27'
|
||||
},
|
||||
{
|
||||
'materialQty': '0',
|
||||
'materialModel': '20/30',
|
||||
'materialCode': 'MT-14AT',
|
||||
'createTime': '01-20 10:08:29'
|
||||
},
|
||||
{
|
||||
'materialQty': '0',
|
||||
'materialModel': '20/30',
|
||||
'materialCode': 'MT-14AT',
|
||||
'createTime': '01-20 09:23:01'
|
||||
},
|
||||
{
|
||||
'materialQty': '0',
|
||||
'materialModel': '20/30',
|
||||
'materialCode': 'MT-14AT',
|
||||
'createTime': '01-20 09:00:53'
|
||||
},
|
||||
{
|
||||
'materialQty': '252',
|
||||
'materialModel': null,
|
||||
'materialCode': null,
|
||||
'createTime': '01-14 13:23:47'
|
||||
}
|
||||
],
|
||||
'lastWorkOrderList': [
|
||||
{
|
||||
'pointCode': 'HCHJ02',
|
||||
'pointName': '缓存货架02',
|
||||
'materialCode': 'ML-70BD',
|
||||
'materialModel': '20/10',
|
||||
'materialSpec': 'BB',
|
||||
'materialQty': '252',
|
||||
'vehicleCode': '0014',
|
||||
'createTime': '2024-03-29 09:56:15'
|
||||
},
|
||||
{
|
||||
'pointCode': 'HCHJ03',
|
||||
'pointName': '缓存货架03',
|
||||
'materialCode': 'ML-70BD',
|
||||
'materialModel': '20/10',
|
||||
'materialSpec': 'BB',
|
||||
'materialQty': '252',
|
||||
'vehicleCode': '1045',
|
||||
'createTime': '2024-03-30 13:33:53'
|
||||
},
|
||||
{
|
||||
'pointCode': 'HCHJ04',
|
||||
'pointName': '缓存货架04',
|
||||
'materialCode': 'ML-70BD',
|
||||
'materialModel': '20/10',
|
||||
'materialSpec': 'BB',
|
||||
'materialQty': '252',
|
||||
'vehicleCode': '1089',
|
||||
'createTime': '2024-03-30 13:41:56'
|
||||
}
|
||||
]
|
||||
}
|
||||
return res
|
||||
}
|
||||
2781
src/config/mork2.js
Normal file
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.png
Normal file
|
After Width: | Height: | Size: 66 KiB |
BIN
src/images/bg-center.png
Normal file
|
After Width: | Height: | Size: 896 KiB |
BIN
src/images/bg-left.png
Normal file
|
After Width: | Height: | Size: 32 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_2.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
src/images/bg.jpg
Normal file
|
After Width: | Height: | Size: 59 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/header_bg.png
Normal file
|
After Width: | Height: | Size: 119 KiB |
BIN
src/images/line_selected.png
Normal file
|
After Width: | Height: | Size: 1005 B |
BIN
src/images/pie-bg_2.png
Normal file
|
After Width: | Height: | Size: 60 KiB |
BIN
src/images/popup_bg.png
Normal file
|
After Width: | Height: | Size: 7.0 KiB |
BIN
src/images/popup_line.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
src/images/scene.png
Normal file
|
After Width: | Height: | Size: 830 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 |
28
src/main.js
Normal file
@@ -0,0 +1,28 @@
|
||||
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, Select, Option} from 'element-ui'
|
||||
|
||||
Vue.prototype.$echarts = echarts
|
||||
Vue.use(VueParticles)
|
||||
Vue.use(scroll)
|
||||
Vue.prototype.$message = Message
|
||||
Vue.use(Select)
|
||||
Vue.use(Option)
|
||||
Vue.config.productionTip = false
|
||||
/* eslint-disable no-new */
|
||||
new Vue({
|
||||
el: '#app',
|
||||
router,
|
||||
store,
|
||||
components: { App },
|
||||
template: '<App/>'
|
||||
})
|
||||
166
src/pages/Setup.vue
Normal file
@@ -0,0 +1,166 @@
|
||||
<template>
|
||||
<div class="login-container">
|
||||
<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>
|
||||
<button class="btn" @click="_config">配置</button>
|
||||
<!-- <button class="btn" @click="getCc">获取尺寸</button> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import SelectOpt from '@components/select.vue'
|
||||
export default {
|
||||
components: {
|
||||
SelectOpt
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
loginname: '',
|
||||
password: '',
|
||||
baseUrl: this.$store.getters.baseUrl,
|
||||
setTime: this.$store.getters.setTime / 1000
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getCc () {
|
||||
const screenWidth = window.screen.width
|
||||
const screenHeight = window.screen.height
|
||||
alert('宽:' + screenWidth + ';' + '高:' + screenHeight + ';')
|
||||
},
|
||||
_config () {
|
||||
if (this.setTime > 10800) {
|
||||
this.$message({
|
||||
message: '刷新时间设置过长',
|
||||
type: 'warning'
|
||||
})
|
||||
return
|
||||
}
|
||||
let obj = {
|
||||
baseUrl: this.baseUrl,
|
||||
setTime: this.setTime * 1000
|
||||
}
|
||||
this.$store.dispatch('setConfig', obj)
|
||||
this.$router.push('/home')
|
||||
let element = document.documentElement
|
||||
if (!(document.fullscreenElement || document.mozFullscreenElement || document.webkitFullscreenElement || document.msFullscreenElement)) {
|
||||
if (element.requestFullscreen) {
|
||||
element.requestFullscreen()
|
||||
} else if (element.webkitRequestFullScreen) {
|
||||
element.webkitRequestFullScreen()
|
||||
} else if (element.mozRequestFullScreen) {
|
||||
element.mozRequestFullScreen()
|
||||
} else if (element.msRequestFullscreen) {
|
||||
// IE11
|
||||
element.msRequestFullscreen()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
@import '~@style/mixin'
|
||||
.login-container
|
||||
position relative
|
||||
_wh(100%, 100%)
|
||||
z-index 1
|
||||
.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 40px
|
||||
line-height 40px
|
||||
width 100%
|
||||
margin-bottom 12px
|
||||
.inputStyle
|
||||
_wh(calc(100% - 116px), 40px)
|
||||
font-size 14px
|
||||
background none
|
||||
line-height 40px
|
||||
color #606266
|
||||
padding 0 15px
|
||||
border none
|
||||
box-sizing border-box
|
||||
background-color #ffffff
|
||||
.select-wraper
|
||||
_wh(calc(100% - 116px), 40px)
|
||||
.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 40px
|
||||
color #333333
|
||||
.el-select
|
||||
width 100%
|
||||
</style>
|
||||
133
src/pages/modules/home/canvas.vue
Normal file
@@ -0,0 +1,133 @@
|
||||
<template>
|
||||
<!-- <div class="canvas_container" @click="rectClick"> -->
|
||||
<div class="canvas_container">
|
||||
<canvas id="myCanvas" width="946" height="982"></canvas>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// 屏幕分辨率为1920*1200
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
af: undefined,
|
||||
points: [{x1: 305, y1: 563, x2: 305, y2: 550}, {x1: 419, y1: 514, x2: 419, y2: 494}, {x1: 453, y1: 282, x2: 550, y2: 282}, {x1: 830, y1: 395, x2: 830, y2: 474}, {x1: 830, y1: 499, x2: 830, y2: 563}, {x1: 830, y1: 516, x2: 488, y2: 516}, {x1: 488, y1: 516, x2: 488, y2: 563}],
|
||||
dot4: {x1: 305, y1: 563, x2: 305, y2: 550},
|
||||
dot5: {x1: 419, y1: 514, x2: 419, y2: 494},
|
||||
dot6: {x1: 453, y1: 282, x2: 550, y2: 282},
|
||||
line2: 1,
|
||||
line3: 1,
|
||||
dot7: {x1: 830, y1: 395, x2: 830, y2: 474},
|
||||
dot8: {x1: 830, y1: 499, x2: 830, y2: 563},
|
||||
dot9: {x1: 830, y1: 516, x2: 488, y2: 516},
|
||||
dot10: {x1: 488, y1: 516, x2: 488, y2: 563},
|
||||
line4: 1
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.animate()
|
||||
},
|
||||
destroyed () {
|
||||
window.cancelAnimationFrame(this.af)
|
||||
this.af = undefined
|
||||
},
|
||||
methods: {
|
||||
rectClick () {
|
||||
var ev = window.event
|
||||
// 获取相对于当前所指向对象的位置坐标
|
||||
alert('x:' + ev.offsetX + 'y:' + ev.offsetY)
|
||||
},
|
||||
drawPoint (ctx, x, y) {
|
||||
ctx.beginPath()
|
||||
ctx.arc(x, y, 4, 0, 2 * Math.PI)
|
||||
ctx.fillStyle = 'yellow'
|
||||
ctx.fill()
|
||||
ctx.lineWidth = 1
|
||||
ctx.strokeStyle = 'yellow'
|
||||
ctx.closePath()
|
||||
},
|
||||
drawLine (ctx, x1, y1, x2, y2) {
|
||||
ctx.beginPath()
|
||||
ctx.moveTo(x1, y1)
|
||||
ctx.lineTo(x2, y2)
|
||||
ctx.strokeStyle = '#00c8da'
|
||||
ctx.lineWidth = 1
|
||||
ctx.stroke()
|
||||
},
|
||||
animate () {
|
||||
let canvas = document.getElementById('myCanvas')
|
||||
let ctx = canvas.getContext('2d')
|
||||
ctx.clearRect(0, 0, canvas.width, canvas.height)
|
||||
if (this.line2 === 1) {
|
||||
this.dot4.y1 -= 1
|
||||
this.drawPoint(ctx, this.dot4.x1, this.dot4.y1)
|
||||
if (this.dot4.y1 === this.dot4.y2) {
|
||||
this.dot4.y1 = 560
|
||||
this.line2 = 2
|
||||
}
|
||||
}
|
||||
if (this.line2 === 2) {
|
||||
this.dot5.y1 -= 1
|
||||
this.drawPoint(ctx, this.dot5.x1, this.dot5.y1)
|
||||
if (this.dot5.y1 === this.dot5.y2) {
|
||||
this.dot5.y1 = 510
|
||||
this.line2 = 1
|
||||
}
|
||||
}
|
||||
if (this.line3 === 1) {
|
||||
this.dot6.x1 += 1
|
||||
this.drawPoint(ctx, this.dot6.x1, this.dot6.y1)
|
||||
if (this.dot6.x1 === this.dot6.x2) {
|
||||
this.dot6.x1 = 455
|
||||
this.line3 = 1
|
||||
}
|
||||
}
|
||||
if (this.line4 === 1) {
|
||||
this.dot7.y1 += 1
|
||||
this.drawPoint(ctx, this.dot7.x1, this.dot7.y1)
|
||||
if (this.dot7.y1 === this.dot7.y2) {
|
||||
this.dot7.y1 = 395
|
||||
this.line4 = 2
|
||||
}
|
||||
}
|
||||
if (this.line4 === 2) {
|
||||
this.dot8.y1 += 1
|
||||
this.drawPoint(ctx, this.dot8.x1, this.dot8.y1)
|
||||
if (this.dot8.y1 === this.dot8.y2) {
|
||||
this.dot8.y1 = 499
|
||||
this.line4 = 3
|
||||
}
|
||||
}
|
||||
if (this.line4 === 3) {
|
||||
this.dot9.x1 -= 1
|
||||
this.drawPoint(ctx, this.dot9.x1, this.dot9.y1)
|
||||
if (this.dot9.x1 === this.dot9.x2) {
|
||||
this.dot9.x1 = 830
|
||||
this.line4 = 4
|
||||
}
|
||||
}
|
||||
if (this.line4 === 4) {
|
||||
this.dot10.y1 += 1
|
||||
this.drawPoint(ctx, this.dot10.x1, this.dot10.y1)
|
||||
if (this.dot10.y1 === this.dot10.y2) {
|
||||
this.dot10.y1 = 516
|
||||
this.line4 = 1
|
||||
}
|
||||
}
|
||||
for (let i = 0; i < this.points.length; i++) {
|
||||
this.drawLine(ctx, this.points[i].x1, this.points[i].y1, this.points[i].x2, this.points[i].y2)
|
||||
}
|
||||
this.af = window.requestAnimationFrame(this.animate)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="stylus" scoped>
|
||||
@import '~@style/mixin'
|
||||
.canvas_container
|
||||
position absolute
|
||||
top 0
|
||||
left 0
|
||||
_wh(946px, 982px)
|
||||
// background red
|
||||
</style>
|
||||
371
src/pages/modules/home/devicepop.vue
Normal file
@@ -0,0 +1,371 @@
|
||||
<template>
|
||||
<div ref="pop" class="popup_wraper">
|
||||
<div class="popup_bg">
|
||||
<div class="popup_block">
|
||||
<div class="pop_header">
|
||||
<div v-show="type === 'yaossx' || type === 'yao' || type === 'hljdjw' || type === 'rgfjc' || type === 'hchj' || type === 'klhw'" class="pop_name">{{data.pointName}}</div>
|
||||
<div v-show="type === 'yj' || type === 'jxs' || type === 'yjmdw' || type === 'fjmdw' || type === 'yjxlw' || type === 'yjslw' || type === 'hlj'" class="pop_name">{{data.device_code}}</div>
|
||||
<div v-show="type === 'yaossx'" class="pop_status">
|
||||
<div class="pop_status_dot" :class="['gray', 'yellow', 'green', 'red'][Number(data.stat)]"></div>
|
||||
<div class="pop_status_text fgray">{{ ['停机', '暂停', '运行', '故障'][Number(data.stat)] }}</div>
|
||||
</div>
|
||||
<div v-show="type === 'yj' || type === 'jxs' || type === 'hlj' || type === 'yjmdw' || type === 'fjmdw' || type === 'yjxlw' || type === 'yjslw'" class="pop_status">
|
||||
<div class="pop_status_dot" :class="['gray', 'yellow', 'green', 'red'][Number(data.device_status)]"></div>
|
||||
<div class="pop_status_text fgray">{{ ['停机', '暂停', '运行', '故障'][Number(data.device_status)] }}</div>
|
||||
</div>
|
||||
<div v-show="type === 'rgfjc'" class="pop_status">
|
||||
<div class="pop_status_text fgray">{{ ['无货', '有货'][Number(data.pointStatus) - 1] }}</div>
|
||||
</div>
|
||||
<div v-show="type === 'hchj'" class="pop_status">
|
||||
<div class="pop_status_text fgray">{{ ['空位', '空盘', '有料'][Number(data.pointStatus) - 1] }}</div>
|
||||
</div>
|
||||
<div v-show="type === 'klhw'" class="pop_status">
|
||||
<div class="pop_status_text fgray">{{ ['空位', '空盅', '满盅'][Number(data.pointStatus) - 1] }}</div>
|
||||
</div>
|
||||
<div v-show="type === 'hljdjw'" class="pop_status">
|
||||
<div class="pop_status_dot" :class="['gray', 'yellow', 'green', 'red'][Number(data.pointStatus)]"></div>
|
||||
<div class="pop_status_text fgray">{{ ['停机', '暂停', '运行', '故障'][Number(data.pointStatus)] }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-show="type === 'yaossx'" class="pop_content">
|
||||
<div class="popup_item">
|
||||
<div class="popup_label">当日已输送托盘数</div>
|
||||
<div class="popup_val">{{ data.deliveredPalletNum }}</div>
|
||||
</div>
|
||||
<div class="popup_item">
|
||||
<div class="popup_label">当日已输送数量</div>
|
||||
<div class="popup_val">{{ data.deliveredMaterialNum }}</div>
|
||||
</div>
|
||||
<div class="popup_item">
|
||||
<div class="popup_label">当前托盘数</div>
|
||||
<div class="popup_val">{{ data.palletNum }}</div>
|
||||
</div>
|
||||
<div class="popup_item">
|
||||
<div class="popup_label">当前物料数量</div>
|
||||
<div class="popup_val">{{ data.materialNum }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-show="type === 'yao'" class="pop_content">
|
||||
<div class="popup_item">
|
||||
<div class="popup_label">工作时间</div>
|
||||
<div class="popup_val">{{ data.workTime }}</div>
|
||||
</div>
|
||||
<div class="popup_item">
|
||||
<div class="popup_label">窑内托盘数</div>
|
||||
<div class="popup_val">{{ data.palletNum }}</div>
|
||||
</div>
|
||||
<div class="popup_item">
|
||||
<div class="popup_label">窑内物料数量</div>
|
||||
<div class="popup_val">{{ data.materialNum }}</div>
|
||||
</div>
|
||||
<div class="popup_item">
|
||||
<div class="popup_label">当日已生产</div>
|
||||
<div class="popup_val">{{ data.produceNum }}</div>
|
||||
</div>
|
||||
<div class="popup_item">
|
||||
<div class="popup_label">物料说明</div>
|
||||
<div class="popup_val">{{ data.materialInfos }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-show="type === 'yj'" class="pop_content">
|
||||
<div class="popup_item">
|
||||
<div class="popup_label">生产时间</div>
|
||||
<div class="popup_val">{{ data.work_time }}</div>
|
||||
</div>
|
||||
<div class="popup_item">
|
||||
<div class="popup_label">当前已生产数量</div>
|
||||
<div class="popup_val">{{ data.real_qty }}</div>
|
||||
</div>
|
||||
<div v-show="type === 'yj'" class="popup_item">
|
||||
<div class="popup_label">当前已生产重量</div>
|
||||
<div class="popup_val">{{ data.current_weight }}</div>
|
||||
</div>
|
||||
<div class="popup_item">
|
||||
<div class="popup_label">故障</div>
|
||||
<div class="popup_val">{{ data.error }}</div>
|
||||
</div>
|
||||
<div class="popup_item">
|
||||
<div class="popup_label">产品牌号</div>
|
||||
<div class="popup_val">{{ data.materialCode }}</div>
|
||||
</div>
|
||||
<div class="popup_item">
|
||||
<div class="popup_label">产品型号</div>
|
||||
<div class="popup_val">{{ data.materialModel }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-show="type === 'hlj'" class="pop_content">
|
||||
<div class="popup_item">
|
||||
<div class="popup_label">故障时间</div>
|
||||
<div class="popup_val">{{ data.error_time }}</div>
|
||||
</div>
|
||||
<div class="popup_item">
|
||||
<div class="popup_label">待机时间</div>
|
||||
<div class="popup_val">{{ data.stand_time }}</div>
|
||||
</div>
|
||||
<div class="popup_item">
|
||||
<div class="popup_label">开机时间</div>
|
||||
<div class="popup_val">{{ data.open_time }}</div>
|
||||
</div>
|
||||
<div class="popup_item">
|
||||
<div class="popup_label">生产时间</div>
|
||||
<div class="popup_val">{{ data.work_time }}</div>
|
||||
</div>
|
||||
<div class="popup_item">
|
||||
<div class="popup_label">当前已生产数量</div>
|
||||
<div class="popup_val">{{ data.real_qty }}</div>
|
||||
</div>
|
||||
<div v-show="type === 'yj'" class="popup_item">
|
||||
<div class="popup_label">当前已生产重量</div>
|
||||
<div class="popup_val">{{ data.current_weight }}</div>
|
||||
</div>
|
||||
<div class="popup_item">
|
||||
<div class="popup_label">故障</div>
|
||||
<div class="popup_val">{{ data.error }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-show="type === 'jxs'" class="pop_content">
|
||||
<div class="popup_item">
|
||||
<div class="popup_label">故障时间</div>
|
||||
<div class="popup_val">{{ data.error_time }}</div>
|
||||
</div>
|
||||
<div class="popup_item">
|
||||
<div class="popup_label">待机时间</div>
|
||||
<div class="popup_val">{{ data.stand_time }}</div>
|
||||
</div>
|
||||
<div class="popup_item">
|
||||
<div class="popup_label">开机时间</div>
|
||||
<div class="popup_val">{{ data.open_time }}</div>
|
||||
</div>
|
||||
<div class="popup_item">
|
||||
<div class="popup_label">生产时间</div>
|
||||
<div class="popup_val">{{ data.work_time }}</div>
|
||||
</div>
|
||||
<div class="popup_item">
|
||||
<div class="popup_label">拆/码垛数量</div>
|
||||
<div class="popup_val">{{ data.real_qty }}</div>
|
||||
</div>
|
||||
<div class="popup_item">
|
||||
<div class="popup_label">故障</div>
|
||||
<div class="popup_val">{{ data.error }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-show="type === 'yjmdw'" class="pop_content">
|
||||
<div class="popup_item">
|
||||
<div class="popup_label">工作模式</div>
|
||||
<div class="popup_val">{{ data.mode }}</div>
|
||||
</div>
|
||||
<div class="popup_item">
|
||||
<div class="popup_label">光电开关信号</div>
|
||||
<div class="popup_val">{{ data.move }}</div>
|
||||
</div>
|
||||
<div class="popup_item">
|
||||
<div class="popup_label">报警信号</div>
|
||||
<div class="popup_val">{{ data.error }}</div>
|
||||
</div>
|
||||
<div class="popup_item">
|
||||
<div class="popup_label">码盘位当前码盘数量</div>
|
||||
<div class="popup_val">{{ data.encoder_qty }}</div>
|
||||
</div>
|
||||
<div class="popup_item">
|
||||
<div class="popup_label">条码</div>
|
||||
<div class="popup_val">{{ data.barcode }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-show="type === 'fjmdw'" class="pop_content">
|
||||
<div class="popup_item">
|
||||
<div class="popup_label">工作模式</div>
|
||||
<div class="popup_val">{{ data.mode }}</div>
|
||||
</div>
|
||||
<div class="popup_item">
|
||||
<div class="popup_label">光电开关信号</div>
|
||||
<div class="popup_val">{{ data.move }}</div>
|
||||
</div>
|
||||
<div class="popup_item">
|
||||
<div class="popup_label">条码</div>
|
||||
<div class="popup_val">{{ data.barcode }}</div>
|
||||
</div>
|
||||
<div class="popup_item">
|
||||
<div class="popup_label">产品牌号</div>
|
||||
<div class="popup_val">{{ data.materialCode }}</div>
|
||||
</div>
|
||||
<div class="popup_item">
|
||||
<div class="popup_label">产品型号</div>
|
||||
<div class="popup_val">{{ data.materialModel }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-show="type === 'yjxlw'" class="pop_content">
|
||||
<div class="popup_item">
|
||||
<div class="popup_label">工作模式</div>
|
||||
<div class="popup_val">{{ data.mode }}</div>
|
||||
</div>
|
||||
<div class="popup_item">
|
||||
<div class="popup_label">光电开关信号</div>
|
||||
<div class="popup_val">{{ data.move }}</div>
|
||||
</div>
|
||||
<div class="popup_item">
|
||||
<div class="popup_label">码盘位当前码盘数量</div>
|
||||
<div class="popup_val">{{ data.encoder_qty }}</div>
|
||||
</div>
|
||||
<div class="popup_item">
|
||||
<div class="popup_label">条码</div>
|
||||
<div class="popup_val">{{ data.barcode }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-show="type === 'yjslw'" class="pop_content">
|
||||
<div class="popup_item">
|
||||
<div class="popup_label">工作模式</div>
|
||||
<div class="popup_val">{{ data.mode }}</div>
|
||||
</div>
|
||||
<div class="popup_item">
|
||||
<div class="popup_label">光电开关信号</div>
|
||||
<div class="popup_val">{{ data.move }}</div>
|
||||
</div>
|
||||
<div class="popup_item">
|
||||
<div class="popup_label">条码</div>
|
||||
<div class="popup_val">{{ data.barcode }}</div>
|
||||
</div>
|
||||
<div class="popup_item">
|
||||
<div class="popup_label">产品牌号</div>
|
||||
<div class="popup_val">{{ data.materialCode }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-show="type === 'hljdjw'" class="pop_content">
|
||||
<div class="popup_item">
|
||||
<div class="popup_label">点位编码</div>
|
||||
<div class="popup_val">{{ data.pointCode }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-show="type === 'rgfjc'" class="pop_content">
|
||||
<div class="popup_item">
|
||||
<div class="popup_label">点位编码</div>
|
||||
<div class="popup_val">{{ data.pointCode }}</div>
|
||||
</div>
|
||||
<div v-show="data.pointStatus === '3'" class="popup_item">
|
||||
<div class="popup_label">产品牌号</div>
|
||||
<div class="popup_val">{{ data.materialCode }}</div>
|
||||
</div>
|
||||
<div v-show="data.pointStatus === '3'" class="popup_item">
|
||||
<div class="popup_label">产品型号</div>
|
||||
<div class="popup_val">{{ data.materialModel }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-show="type === 'hchj'" class="pop_content">
|
||||
<div class="popup_item">
|
||||
<div class="popup_label">点位编码</div>
|
||||
<div class="popup_val">{{ data.pointCode }}</div>
|
||||
</div>
|
||||
<div v-show="data.pointStatus === '3'" class="popup_item">
|
||||
<div class="popup_label">入库时间</div>
|
||||
<div class="popup_val">{{ data.instorageTime }}</div>
|
||||
</div>
|
||||
<div v-show="data.pointStatus === '3'" class="popup_item">
|
||||
<div class="popup_label">产品牌号</div>
|
||||
<div class="popup_val">{{ data.materialCode }}</div>
|
||||
</div>
|
||||
<div v-show="data.pointStatus === '3'" class="popup_item">
|
||||
<div class="popup_label">产品型号</div>
|
||||
<div class="popup_val">{{ data.materialModel }}</div>
|
||||
</div>
|
||||
<div v-show="data.pointStatus === '3'" class="popup_item">
|
||||
<div class="popup_label">产品数量</div>
|
||||
<div class="popup_val">{{ data.materialQty }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-show="type === 'klhw'" class="pop_content">
|
||||
<div class="popup_item">
|
||||
<div class="popup_label">点位编码</div>
|
||||
<div class="popup_val">{{ data.pointCode }}</div>
|
||||
</div>
|
||||
<div v-show="data.pointStatus === '3'" class="popup_item">
|
||||
<div class="popup_label">产品牌号</div>
|
||||
<div class="popup_val">{{ data.materialCode }}</div>
|
||||
</div>
|
||||
<div v-show="data.pointStatus === '3'" class="popup_item">
|
||||
<div class="popup_label">条码信息</div>
|
||||
<div class="popup_val">{{ data.vehicleCode }}</div>
|
||||
</div>
|
||||
<div v-show="data.pointStatus === '3'" class="popup_item">
|
||||
<div class="popup_label">入库时间</div>
|
||||
<div class="popup_val">{{ data.instorageTime }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'devicepop',
|
||||
props: {
|
||||
type: String,
|
||||
data: Object
|
||||
},
|
||||
methods: {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
@import '~@style/mixin'
|
||||
.popup_wraper
|
||||
display none
|
||||
position fixed
|
||||
z-index 100
|
||||
_wh(530px, auto)
|
||||
padding 20px 0 30px 0
|
||||
background top center / 100% 100% url(../../../images/popup_bg.png) no-repeat
|
||||
.popup_bg
|
||||
_wh(100%, auto)
|
||||
background none
|
||||
overflow hidden
|
||||
.popup_block
|
||||
_wh(100%,100%)
|
||||
padding 0
|
||||
.pop_header
|
||||
_wh(calc(100% - 28px), 43px)
|
||||
padding 15px 5px 0 5px
|
||||
margin 0 14px
|
||||
_fj(flex-end)
|
||||
background top center / 100% 18px url(../../../images/popup_line.png) no-repeat
|
||||
.pop_name
|
||||
width 50%
|
||||
_font(14px,28px,#32C5FF,,left)
|
||||
text-shadow 2px 2px 4px #A6E6FF
|
||||
margin-bottom 8px
|
||||
.pop_status
|
||||
_wh(50%, 28px)
|
||||
_fj(row,flex-end)
|
||||
.pop_status_dot
|
||||
_wh(15px, 15px)
|
||||
border-radius 50%
|
||||
margin-right 10px
|
||||
.pop_status_text
|
||||
_font(16px, 28px, #fff,,)
|
||||
.pop_content
|
||||
_wh(calc(100% - 14px), auto)
|
||||
padding 0 5px
|
||||
margin 0 7px
|
||||
overflow-y auto
|
||||
_fj(flex-start)
|
||||
align-content flex-start
|
||||
flex-wrap wrap
|
||||
.popup_item
|
||||
_wh(calc(50% - 14px), 36px)
|
||||
_fj(row,flex-start)
|
||||
background-color rgba(50,197,255,50%)
|
||||
border-left 3px solid #fdfd0f
|
||||
margin 0 7px 5px 7px
|
||||
padding 0 5px 0 5px
|
||||
.popup_label
|
||||
width 120px
|
||||
_font(12px, 36px, #fff,,left)
|
||||
.popup_val
|
||||
_wh(calc(100% - 120px), 100%)
|
||||
_font(12px, 15px, #0ff,,left)
|
||||
word-break break-all
|
||||
_fj(center)
|
||||
span
|
||||
font-size 13px
|
||||
color #fff
|
||||
</style>
|
||||
1471
src/pages/modules/home/index.vue
Normal file
155
src/pages/modules/home/workshop.vue
Normal file
@@ -0,0 +1,155 @@
|
||||
<template>
|
||||
<div class="center_wrapper">
|
||||
<img src="../../../images/scene.png" width="1095" height="804" usemap="#image-map" @click.stop="closePop">
|
||||
<div class="status_icon"></div>
|
||||
<map name="image-map" id="map">
|
||||
<area v-for="(e, i) in areaList" :key="i" :alt="e.device_code" :title="e.device_code" :coords="e.coords" :shape="e.shape" @click="showPop($event, e)">
|
||||
</map>
|
||||
<device-pop ref="pop" :type="pkObj.type" :data="pkObj"/>
|
||||
<!-- <div v-show="pkId !== ''" ref="pointer" class="pop_pointer"></div> -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import DevicePop from './devicepop.vue'
|
||||
// import {deviceCondition, inOutKilnDetail, kilnDetail} from '@js/getData2.js'
|
||||
import {deviceCondition} from '@js/mork2.js'
|
||||
export default {
|
||||
name: 'workshop',
|
||||
components: {
|
||||
DevicePop: DevicePop
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
areaList: [
|
||||
{type: 'hlj', device_code: 'HNJ01', coords: '93,178,104,191', shape: 'rect'},
|
||||
{type: 'hlj', device_code: 'HNJ02', coords: '701,136,683,121', shape: 'rect'},
|
||||
{type: 'hlj', device_code: 'HNJ03', coords: '648,136,632,120', shape: 'rect'},
|
||||
{type: 'hlj', device_code: 'HNJ04', coords: '621,137,602,120', shape: 'rect'}
|
||||
],
|
||||
interTime: this.$store.getters.setTime,
|
||||
wsTimer: null,
|
||||
MixMachineList: [], // 混碾机
|
||||
pkId: '',
|
||||
pkObj: {}
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this._deviceCondition()
|
||||
// this.refresh()
|
||||
},
|
||||
beforeDestroy () {
|
||||
clearInterval(this.wsTimer)
|
||||
this.wsTimer = null
|
||||
},
|
||||
destroyed () {
|
||||
clearInterval(this.wsTimer)
|
||||
this.wsTimer = null
|
||||
},
|
||||
methods: {
|
||||
showPop ($event, e) {
|
||||
this.pkId = this.pkId === e.device_code ? '' : e.device_code
|
||||
if (this.pkId) {
|
||||
this.$refs.pop.$el.style.display = 'block'
|
||||
this.$refs.pop.$el.style.left = $event.x + 'px'
|
||||
this.$refs.pop.$el.style.top = $event.y + 'px'
|
||||
} else {
|
||||
this.$refs.pop.$el.style.display = 'none'
|
||||
}
|
||||
if (e.type === 'hlj') {
|
||||
this.MixMachineList.map(el => {
|
||||
if (el.device_code === e.device_code) {
|
||||
this.pkObj = el
|
||||
this.pkObj.type = e.type
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
closePop () {
|
||||
this.$refs.pop.$el.style.display = 'none'
|
||||
this.pkId = ''
|
||||
},
|
||||
refresh () {
|
||||
this.wsTimer = setInterval(() => {
|
||||
this._deviceCondition()
|
||||
}, this.interTime)
|
||||
},
|
||||
async _deviceCondition () {
|
||||
let res = await deviceCondition()
|
||||
this.MixMachineList = [...res.MixMachineList]
|
||||
console.log(this.MixMachineList)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
.center_wrapper
|
||||
position relative
|
||||
width 1095px
|
||||
height 804px
|
||||
.pop_pointer
|
||||
position: fixed;
|
||||
z-index 101;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
background-color: #fff;
|
||||
border-radius: 50%;
|
||||
box-shadow: 0 0 5px #fff, 0 0 10px #fff, 0 0 15px #00c4ff, 0 0 20px #00c4ff, 0 0 25px #00c4ff;
|
||||
&::after
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: #00c4ff;
|
||||
border-radius: 50%;
|
||||
box-shadow: 0 0 5px #00c4ff;
|
||||
animation: glow 2s infinite
|
||||
@keyframes glow {
|
||||
0% {
|
||||
transform: scale(0.5);
|
||||
opacity: 0;
|
||||
}
|
||||
50% {
|
||||
opacity: 1;
|
||||
}
|
||||
100% {
|
||||
transform: scale(1.5);
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
.status_icon
|
||||
position absolute
|
||||
z-index 1
|
||||
left 93px
|
||||
top 178px
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
background-color: #fff;
|
||||
border-radius: 50%;
|
||||
box-shadow: 0 0 5px #fff, 0 0 10px #fff, 0 0 15px #00c4ff, 0 0 20px #00c4ff, 0 0 25px #00c4ff;
|
||||
&::after
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: #00c4ff;
|
||||
border-radius: 50%;
|
||||
box-shadow: 0 0 5px #00c4ff;
|
||||
animation: glow 2s infinite
|
||||
map
|
||||
position absolute
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index 100
|
||||
area, .status_icon {
|
||||
pointer-events: none; /* 防止其他元素影响点击事件 */
|
||||
}
|
||||
area {
|
||||
pointer-events: auto;
|
||||
}
|
||||
</style>
|
||||
25
src/router/index.js
Normal file
@@ -0,0 +1,25 @@
|
||||
import Vue from 'vue'
|
||||
import Router from 'vue-router'
|
||||
|
||||
const Setup = r => require.ensure([], () => r(require('@page/Setup')), 'Setup')
|
||||
const home = r => require.ensure([], () => r(require('@page/modules/home/index')), 'home')
|
||||
|
||||
Vue.use(Router)
|
||||
|
||||
export default new Router({
|
||||
linkActiveClass: 'tab-active',
|
||||
routes: [
|
||||
{
|
||||
path: '/',
|
||||
redirect: '/setup'
|
||||
},
|
||||
{
|
||||
path: '/setup',
|
||||
component: Setup
|
||||
},
|
||||
{
|
||||
path: '/home',
|
||||
component: home
|
||||
}
|
||||
]
|
||||
})
|
||||
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";
|
||||
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";
|
||||
}
|
||||
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
|
||||
159
src/style/reset.css
Normal file
@@ -0,0 +1,159 @@
|
||||
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: 1920px;
|
||||
height: 100%;
|
||||
min-height: 1080px;
|
||||
}
|
||||
|
||||
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: center center / 100% 100% url(../images/bg.jpg) no-repeat;
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
.absolute {
|
||||
position: absolute
|
||||
}
|
||||
|
||||
.flexwrap {
|
||||
flex-wrap: wrap
|
||||
}
|
||||
48
src/vuex/modules/com.js
Normal file
@@ -0,0 +1,48 @@
|
||||
import * as types from '../types'
|
||||
import { getStore, setStore } from '@js/mUtils.js'
|
||||
|
||||
const baseUrl = process.env.NODE_ENV === 'development' ? 'http://192.168.8.162:8010' : 'http://192.168.8.162:8010'
|
||||
const lcUrl = process.env.NODE_ENV === 'development' ? 'http://192.168.8.160:8010' : 'http://192.168.8.160:8010'
|
||||
|
||||
/**
|
||||
* App通用配置
|
||||
*/
|
||||
const state = {
|
||||
baseUrl: getStore('baseUrl') || baseUrl,
|
||||
lcUrl: getStore('lcUrl') || lcUrl,
|
||||
setTime: getStore('setTime') || 50000,
|
||||
equipId: getStore('equipId') || '1'
|
||||
}
|
||||
|
||||
const actions = {
|
||||
setConfig ({commit}, res) {
|
||||
setStore('baseUrl', res.baseUrl)
|
||||
setStore('lcUrl', res.lcUrl)
|
||||
setStore('setTime', res.setTime)
|
||||
setStore('equipId', res.equipId)
|
||||
commit(types.COM_CONFIG, res)
|
||||
}
|
||||
}
|
||||
|
||||
const getters = {
|
||||
baseUrl: state => state.baseUrl,
|
||||
lcUrl: state => state.lcUrl,
|
||||
setTime: state => state.setTime,
|
||||
equipId: state => state.equipId
|
||||
}
|
||||
|
||||
const mutations = {
|
||||
[types.COM_CONFIG] (state, res) {
|
||||
state.baseUrl = res.baseUrl
|
||||
state.lcUrl = res.lcUrl
|
||||
state.setTime = res.setTime
|
||||
state.equipId = res.equipId
|
||||
}
|
||||
}
|
||||
|
||||
export default {
|
||||
state,
|
||||
actions,
|
||||
getters,
|
||||
mutations
|
||||
}
|
||||
52
src/vuex/modules/user.js
Normal file
@@ -0,0 +1,52 @@
|
||||
import * as types from '../types'
|
||||
import { getStore, setStore } from '@js/mUtils.js'
|
||||
|
||||
const state = {
|
||||
accountId: getStore('accountId') || '',
|
||||
accountName: getStore('accountName') || '',
|
||||
userName: getStore('userName') || '',
|
||||
deptUuid: getStore('deptUuid') || ''
|
||||
}
|
||||
|
||||
const getters = {
|
||||
accountId: state => state.accountId,
|
||||
accountName: state => state.accountName,
|
||||
userName: state => state.userName,
|
||||
deptUuid: state => state.deptUuid
|
||||
}
|
||||
|
||||
const actions = {
|
||||
setUserInfo ({ commit }, res) {
|
||||
setStore('accountId', res.account_id)
|
||||
setStore('accountName', res.account_name)
|
||||
setStore('userName', res.user_name)
|
||||
setStore('deptUuid', res.dept_uuid)
|
||||
commit(types.SET_USER_INFO, res)
|
||||
},
|
||||
setSignOut ({ commit }) {
|
||||
localStorage.removeItem('accountId')
|
||||
localStorage.removeItem('userName')
|
||||
localStorage.removeItem('accountName')
|
||||
localStorage.removeItem('deptUuid')
|
||||
commit(types.SET_SIGN_OUT)
|
||||
}
|
||||
}
|
||||
|
||||
const mutations = {
|
||||
[types.SET_USER_INFO] (state, res) {
|
||||
state.accountId = res.account_id
|
||||
state.accountName = res.account_name
|
||||
state.userName = res.user_name
|
||||
state.memberName = res.member_name
|
||||
},
|
||||
[types.SET_SIGN_OUT] (state) {
|
||||
state.accountId = ''
|
||||
}
|
||||
}
|
||||
|
||||
export default {
|
||||
state,
|
||||
getters,
|
||||
actions,
|
||||
mutations
|
||||
}
|
||||
14
src/vuex/store.js
Normal file
@@ -0,0 +1,14 @@
|
||||
import Vue from 'vue'
|
||||
import Vuex from 'vuex'
|
||||
|
||||
import user from './modules/user'
|
||||
import com from './modules/com'
|
||||
|
||||
Vue.use(Vuex)
|
||||
|
||||
export default new Vuex.Store({
|
||||
modules: {
|
||||
user,
|
||||
com
|
||||
}
|
||||
})
|
||||
6
src/vuex/types.js
Normal file
@@ -0,0 +1,6 @@
|
||||
// 公共配置
|
||||
export const COM_CONFIG = 'COM_CONFIG'
|
||||
|
||||
// 用户
|
||||
export const SET_USER_INFO = 'SET_USER_INFO'
|
||||
export const SET_SIGN_OUT = 'SET_SIGN_OUT'
|
||||
0
static/.gitkeep
Normal file
180
static/result.json
Normal file
@@ -0,0 +1,180 @@
|
||||
{
|
||||
"code":"1",
|
||||
"desc":"查询成功",
|
||||
"result":{
|
||||
"yDateMax":6000,
|
||||
"xDate":[
|
||||
{
|
||||
"id":"12-25"
|
||||
},
|
||||
{
|
||||
"id":"12-26"
|
||||
},
|
||||
{
|
||||
"id":"12-27"
|
||||
},
|
||||
{
|
||||
"id":"12-28"
|
||||
},
|
||||
{
|
||||
"id":"12-29"
|
||||
},
|
||||
{
|
||||
"id":"12-30"
|
||||
},
|
||||
{
|
||||
"id":"12-31"
|
||||
},
|
||||
{
|
||||
"id":"1-1"
|
||||
},
|
||||
{
|
||||
"id":"1-2"
|
||||
},
|
||||
{
|
||||
"id":"1-3"
|
||||
},
|
||||
{
|
||||
"id":"1-4"
|
||||
},
|
||||
{
|
||||
"id":"1-5"
|
||||
},
|
||||
{
|
||||
"id":"1-6"
|
||||
},
|
||||
{
|
||||
"id":"1-7"
|
||||
}
|
||||
],
|
||||
"yDate0":[
|
||||
{
|
||||
"num":"1000"
|
||||
},
|
||||
{
|
||||
"num":"1500"
|
||||
},
|
||||
{
|
||||
"num":"0"
|
||||
},
|
||||
{
|
||||
"num":"2300"
|
||||
},
|
||||
{
|
||||
"num":"4300"
|
||||
},
|
||||
{
|
||||
"num":"3900"
|
||||
},
|
||||
{
|
||||
"num":"2800"
|
||||
},
|
||||
{
|
||||
"num":"2600"
|
||||
},
|
||||
{
|
||||
"num":"2500"
|
||||
},
|
||||
{
|
||||
"num":"4500"
|
||||
},
|
||||
{
|
||||
"num":"1200"
|
||||
},
|
||||
{
|
||||
"num":"1800"
|
||||
},
|
||||
{
|
||||
"num":"1900"
|
||||
},
|
||||
{
|
||||
"num":"1700"
|
||||
}
|
||||
],
|
||||
"yDate1":[
|
||||
{
|
||||
"num":"900"
|
||||
},
|
||||
{
|
||||
"num":"1400"
|
||||
},
|
||||
{
|
||||
"num":"2600"
|
||||
},
|
||||
{
|
||||
"num":"2200"
|
||||
},
|
||||
{
|
||||
"num":"4200"
|
||||
},
|
||||
{
|
||||
"num":"3800"
|
||||
},
|
||||
{
|
||||
"num":"2500"
|
||||
},
|
||||
{
|
||||
"num":"2300"
|
||||
},
|
||||
{
|
||||
"num":"2400"
|
||||
},
|
||||
{
|
||||
"num":"4000"
|
||||
},
|
||||
{
|
||||
"num":"1000"
|
||||
},
|
||||
{
|
||||
"num":"1200"
|
||||
},
|
||||
{
|
||||
"num":"1100"
|
||||
},
|
||||
{
|
||||
"num":"1100"
|
||||
}
|
||||
],
|
||||
"yDate2":[
|
||||
{
|
||||
"num":"0"
|
||||
},
|
||||
{
|
||||
"num":"0"
|
||||
},
|
||||
{
|
||||
"num":"1200"
|
||||
},
|
||||
{
|
||||
"num":"0"
|
||||
},
|
||||
{
|
||||
"num":"0"
|
||||
},
|
||||
{
|
||||
"num":"0"
|
||||
},
|
||||
{
|
||||
"num":"0"
|
||||
},
|
||||
{
|
||||
"num":"0"
|
||||
},
|
||||
{
|
||||
"num":"0"
|
||||
},
|
||||
{
|
||||
"num":"0"
|
||||
},
|
||||
{
|
||||
"num":"0"
|
||||
},
|
||||
{
|
||||
"num":"0"
|
||||
},
|
||||
{
|
||||
"num":"0"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||