Commit 0086e7af authored by 黄媛媛's avatar 黄媛媛

初始化项目

parent d113c0d8
Pipeline #35 canceled with stages
{
"presets": [
["env", {
"modules": false,
"targets": {
"browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
}
}],
"stage-2"
],
"plugins": ["transform-vue-jsx", "transform-runtime"],
"env": {
"test": {
"presets": ["env", "stage-2"],
"plugins": ["transform-vue-jsx", "transform-es2015-modules-commonjs", "dynamic-import-node"]
}
}
}
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
.DS_Store
node_modules/
/dist/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
/test/unit/coverage/
/test/e2e/reports/
selenium-debug.log
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
// 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": {}
}
}
# assets
> A Vue.js project
## Build Setup
``` bash
# install dependencies
npm install
# serve with hot reload at localhost:8080
npm run dev
# build for production with minification
npm run build
# build for production and view the bundle analyzer report
npm run build --report
# run unit tests
npm run unit
# run e2e tests
npm run e2e
# run all tests
npm test
```
For a detailed explanation on how things work, check out the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader).
'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'
))
})
})
'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)
}
}
'use strict'
const path = require('path')
const config = require('../config')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const packageConfig = require('../package.json')
exports.assetsPath = function (_path) {
const assetsSubDirectory = process.env.NODE_ENV === 'production'
? config.build.assetsSubDirectory
: config.dev.assetsSubDirectory
return path.posix.join(assetsSubDirectory, _path)
}
exports.cssLoaders = function (options) {
options = options || {}
const cssLoader = {
loader: 'css-loader',
options: {
sourceMap: options.sourceMap
}
}
const postcssLoader = {
loader: 'postcss-loader',
options: {
sourceMap: options.sourceMap
}
}
// generate loader string to be used with extract text plugin
function generateLoaders (loader, loaderOptions) {
const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader]
if (loader) {
loaders.push({
loader: loader + '-loader',
options: Object.assign({}, loaderOptions, {
sourceMap: options.sourceMap
})
})
}
// Extract CSS when that option is specified
// (which is the case during production build)
if (options.extract) {
return ExtractTextPlugin.extract({
use: loaders,
fallback: 'vue-style-loader'
})
} else {
return ['vue-style-loader'].concat(loaders)
}
}
// https://vue-loader.vuejs.org/en/configurations/extract-css.html
return {
css: generateLoaders(),
postcss: generateLoaders(),
less: generateLoaders('less'),
sass: generateLoaders('sass', { indentedSyntax: true }),
scss: generateLoaders('sass'),
stylus: generateLoaders('stylus'),
styl: generateLoaders('stylus')
}
}
// Generate loaders for standalone style files (outside of .vue)
exports.styleLoaders = function (options) {
const output = []
const loaders = exports.cssLoaders(options)
for (const extension in loaders) {
const loader = loaders[extension]
output.push({
test: new RegExp('\\.' + extension + '$'),
use: loader
})
}
return output
}
exports.createNotifierCallback = () => {
const notifier = require('node-notifier')
return (severity, errors) => {
if (severity !== 'error') return
const error = errors[0]
const filename = error.file && error.file.split('!').pop()
notifier.notify({
title: packageConfig.name,
message: severity + ': ' + error.name,
subtitle: filename || '',
icon: path.join(__dirname, 'logo.png')
})
}
}
'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'
}
}
'use strict'
const path = require('path')
const utils = require('./utils')
const config = require('../config')
const vueLoaderConfig = require('./vue-loader.conf')
function resolve (dir) {
return path.join(__dirname, '..', dir)
}
module.exports = {
context: path.resolve(__dirname, '../'),
entry: {
app: './src/main.js'
},
output: {
path: config.build.assetsRoot,
filename: '[name].js',
publicPath: process.env.NODE_ENV === 'production'
? config.build.assetsPublicPath
: config.dev.assetsPublicPath
},
resolve: {
extensions: ['.js', '.vue', '.json'],
alias: {
'vue$': 'vue/dist/vue.esm.js',
'@': resolve('src'),
}
},
module: {
rules: [
{
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'
}
}
'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)
}
})
})
'use strict'
const path = require('path')
const utils = require('./utils')
const webpack = require('webpack')
const config = require('../config')
const merge = require('webpack-merge')
const baseWebpackConfig = require('./webpack.base.conf')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin')
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
const env = process.env.NODE_ENV === 'testing'
? require('../config/test.env')
: require('../config/prod.env')
const webpackConfig = merge(baseWebpackConfig, {
module: {
rules: utils.styleLoaders({
sourceMap: config.build.productionSourceMap,
extract: true,
usePostCSS: true
})
},
devtool: config.build.productionSourceMap ? config.build.devtool : false,
output: {
path: config.build.assetsRoot,
filename: utils.assetsPath('js/[name].[chunkhash].js'),
chunkFilename: utils.assetsPath('js/[id].[chunkhash].js')
},
plugins: [
// http://vuejs.github.io/vue-loader/en/workflow/production.html
new webpack.DefinePlugin({
'process.env': env
}),
new UglifyJsPlugin({
uglifyOptions: {
compress: {
warnings: false
}
},
sourceMap: config.build.productionSourceMap,
parallel: true
}),
// extract css into its own file
new ExtractTextPlugin({
filename: utils.assetsPath('css/[name].[contenthash].css'),
// Setting the following option to `false` will not extract CSS from codesplit chunks.
// Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack.
// It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`,
// increasing file size: https://github.com/vuejs-templates/webpack/issues/1110
allChunks: true,
}),
// Compress extracted CSS. We are using this plugin so that possible
// duplicated CSS from different components can be deduped.
new OptimizeCSSPlugin({
cssProcessorOptions: config.build.productionSourceMap
? { safe: true, map: { inline: false } }
: { safe: true }
}),
// generate dist index.html with correct asset hash for caching.
// you can customize output by editing /index.html
// see https://github.com/ampedandwired/html-webpack-plugin
new HtmlWebpackPlugin({
filename: process.env.NODE_ENV === 'testing'
? 'index.html'
: config.build.index,
template: 'index.html',
inject: true,
minify: {
removeComments: true,
collapseWhitespace: true,
removeAttributeQuotes: true
// more options:
// https://github.com/kangax/html-minifier#options-quick-reference
},
// necessary to consistently work with multiple chunks via CommonsChunkPlugin
chunksSortMode: 'dependency'
}),
// keep module.id stable when vendor modules does not change
new webpack.HashedModuleIdsPlugin(),
// enable scope hoisting
new webpack.optimize.ModuleConcatenationPlugin(),
// split vendor js into its own file
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
minChunks (module) {
// any required modules inside node_modules are extracted to vendor
return (
module.resource &&
/\.js$/.test(module.resource) &&
module.resource.indexOf(
path.join(__dirname, '../node_modules')
) === 0
)
}
}),
// extract webpack runtime and module manifest to its own file in order to
// prevent vendor hash from being updated whenever app bundle is updated
new webpack.optimize.CommonsChunkPlugin({
name: 'manifest',
minChunks: Infinity
}),
// This instance extracts shared chunks from code splitted chunks and bundles them
// in a separate chunk, similar to the vendor chunk
// see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk
new webpack.optimize.CommonsChunkPlugin({
name: 'app',
async: 'vendor-async',
children: true,
minChunks: 3
}),
// copy custom static assets
new CopyWebpackPlugin([
{
from: path.resolve(__dirname, '../static'),
to: config.build.assetsSubDirectory,
ignore: ['.*']
}
])
]
})
if (config.build.productionGzip) {
const CompressionWebpackPlugin = require('compression-webpack-plugin')
webpackConfig.plugins.push(
new CompressionWebpackPlugin({
asset: '[path].gz[query]',
algorithm: 'gzip',
test: new RegExp(
'\\.(' +
config.build.productionGzipExtensions.join('|') +
')$'
),
threshold: 10240,
minRatio: 0.8
})
)
}
if (config.build.bundleAnalyzerReport) {
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
webpackConfig.plugins.push(new BundleAnalyzerPlugin())
}
module.exports = webpackConfig
'use strict'
const merge = require('webpack-merge')
const prodEnv = require('./prod.env')
module.exports = merge(prodEnv, {
NODE_ENV: '"development"'
})
'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: {
'/apis': {
target:'http://192.168.2.16:8087',//请求域名
//secure: false, // 如果是https接口,需要配置这个参数
changeOrigin:true,//如果是跨域访问,需要配置这个参数
pathRewrite:{
'^/apis': '/'
}
}
},
// Various Dev Server settings
host: 'www.test.com', // can be overwritten by process.env.HOST
port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
autoOpenBrowser: false,
errorOverlay: true,
notifyOnErrors: true,
poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
/**
* 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
}
}
'use strict'
module.exports = {
NODE_ENV: '"production"'
}
'use strict'
const merge = require('webpack-merge')
const devEnv = require('./dev.env')
module.exports = merge(devEnv, {
NODE_ENV: '"testing"'
})
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
<meta name="renderer" content="webkit">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache, must-revalidate, no-store">
<meta http-equiv="Expires" content="0">
<title>资产管理</title>
</head>
<body>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
This diff is collapsed.
{
"name": "assets",
"version": "1.0.0",
"description": "A Vue.js project",
"author": "cherish6 <1123167945@qq.com>",
"private": true,
"scripts": {
"dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
"start": "npm run dev",
"unit": "jest --config test/unit/jest.conf.js --coverage",
"e2e": "node test/e2e/runner.js",
"test": "npm run unit && npm run e2e",
"build": "node build/build.js"
},
"dependencies": {
"@riophae/vue-treeselect": "^0.4.0",
"axios": "^0.19.0",
"echarts": "^4.5.0",
"element-ui": "^2.13.0",
"js-md5": "^0.7.3",
"moment": "^2.24.0",
"vue": "^2.5.2",
"vue-router": "^3.0.1",
"vxe-table": "^2.6.22",
"xe-utils": "^2.2.15"
},
"devDependencies": {
"autoprefixer": "^7.1.2",
"babel-core": "^6.22.1",
"babel-helper-vue-jsx-merge-props": "^2.0.3",
"babel-jest": "^21.0.2",
"babel-loader": "^7.1.1",
"babel-plugin-dynamic-import-node": "^1.2.0",
"babel-plugin-syntax-jsx": "^6.18.0",
"babel-plugin-transform-es2015-modules-commonjs": "^6.26.0",
"babel-plugin-transform-runtime": "^6.22.0",
"babel-plugin-transform-vue-jsx": "^3.5.0",
"babel-preset-env": "^1.3.2",
"babel-preset-stage-2": "^6.22.0",
"babel-register": "^6.22.0",
"chalk": "^2.0.1",
"chromedriver": "^2.27.2",
"copy-webpack-plugin": "^4.0.1",
"cross-spawn": "^5.0.1",
"css-loader": "^0.28.0",
"extract-text-webpack-plugin": "^3.0.0",
"file-loader": "^1.1.4",
"friendly-errors-webpack-plugin": "^1.6.1",
"html-webpack-plugin": "^2.30.1",
"jest": "^22.0.4",
"jest-serializer-vue": "^0.3.0",
"nightwatch": "^0.9.12",
"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",
"selenium-server": "^3.0.1",
"semver": "^5.3.0",
"shelljs": "^0.7.6",
"uglifyjs-webpack-plugin": "^1.1.1",
"url-loader": "^0.5.8",
"vue-jest": "^1.0.2",
"vue-loader": "^13.3.0",
"vue-style-loader": "^3.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"
]
}
<template>
<div class="App">
<router-view/>
</div>
</template>
<script>
export default {
name: 'App',
}
</script>
<style>
@import "//at.alicdn.com/t/font_1544586_fwxtdv3431f.css";
@import "./assets/css/common.css";
body,html{
padding: 0px;
margin: 0px;
font-family:'微软雅黑',' Microsoft YaHei','PingFang','PingFangR';
-webkit-font-smoothing: antialiased;
height: 100%;
}
.App{
min-width: 1366px;
}
*{
margin: 0;
padding: 0;
}
li{
list-style: none;
}
::-webkit-scrollbar{
width: 4px;
height: 8px;
}
::-webkit-scrollbar-thumb {
border-radius: 4px;
-webkit-box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.2);
background: #c9c9c9;
}
::-webkit-scrollbar-thumb {
-webkit-box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.2);
border-radius: 4px;
background: #EDEDED;
}
</style>
.chartTitle .el-input__icon{
line-height:0;
color:#fff!important;
}
.chartTitle .el-select .el-input__inner{
width: 100%;
height: 100%;
background: transparent;
border:none;
color:#fff;
}
.chaxunSpan{
width:90px;
height:34px;
line-height:34px;
background:rgba(0,210,214,1);
border-radius:17px;
color:#fff;
font-size:12px;
display: inline-block;
text-align: center;
cursor: pointer;
}
.addSpan{
width:90px;
height:34px;
border:1px solid rgba(0,210,214,1);
color:rgba(0,210,214,1);
border-radius:20px;
line-height:34px;
font-size:12px;
display: inline-flex;
align-items: center;
justify-content: center;
cursor: pointer;
}
.pageTitle{
color:#111111;
font-size: 14px;
float: left;
padding-top:10px;
}
.roatImg{
transform: rotate(180deg);
}
/* myTable */
.myTable{
width: 100%;
font-size: 12px;
border-collapse: collapse;
}
.myTable thead th{
color:#A6C6C6;
padding-left: 20px;
height: 60px;
line-height: 60px;
font-weight:bold;
text-align: left;
}
.myTable tr{
height:60px;
background:#fff;
border-bottom: 4px solid #F8FAFB;
cursor: pointer;
}
.myTable tbody tr:hover{
box-shadow:0px 0 20px 0px rgba(176,176,176,0.2);
transition: transform .5s ease;
/* transform: scaleX(1.02); */
}
.myTable tbody tr:hover .commonStyle{
display: block;
transition: transform .5s ease;
box-shadow:0px 0px 0px 0px rgba(176,176,176,0.2);
}
.myTable tbody tr:hover td{
border-radius:0!important;
}
.myTable tbody tr:first-child td:first-child{
border-radius:20px 0 0 0;
}
.myTable tbody tr:first-child td:last-child{
border-radius:0 20px 0 0;
}
.myTable tbody tr:last-child td:first-child{
border-radius:0 0 0 20px;
}
.myTable tbody tr:last-child td:last-child{
border-radius:0 0 20px 0;
}
.myTable tr td{
padding-left: 20px;
position: relative;
}
.f12{
font-size: 12px;
}
.f14{
font-size: 14px;
}
.f22{
font-size: 22px;
}
.c11{
color:#111111;
}
.cd6{
color:#00D2D6;
}
.bold{
font-family: "PingFangSC"
}
.w200{width: 200px!important;}
.el-input{
display: inline-block;
}
.queryul {
margin-top: 20px;
}
.queryul li{
display: inline-block;
min-width:204px;
height:50px;
line-height:50px;
background:rgba(255,255,255,1);
box-shadow:0px 6px 14px 0px rgba(176,176,176,0.1);
border-radius:10px;
margin-right: 20px;
margin-bottom: 20px;
}
.queryul li .el-input__inner::-webkit-input-placeholder {
color: #111111;
}
.queryul li .el-input__inner::-moz-input-placeholder {
color: #111111;
}
.queryul li input::-ms-input-placeholder {
color: #111111;
}
.queryul li .el-input__inner{
border: none;
outline: none;
color:#111111;
}
/* 分页 */
.el-pagination{
margin-top: 20px;
text-align: right;
}
.el-pagination.is-background .btn-next, .el-pagination.is-background .btn-prev, .el-pagination.is-background .el-pager li{
background: #fff;
margin: 0;
border-right: 1px solid #F0F2FA;
color:#666666;
font-size: 14px;
font-weight:100;
}
.el-pagination.is-background .el-pager li:not(.disabled).active{
background-color: #28CACC;
}
.el-pager li{
padding: 0;
font-size: 14px;
width: 40px;
height: 30px;
line-height: 30px;
text-align: center;
}
.el-pagination button, .el-pagination span:not([class*=suffix]){
height: 30px;
line-height: 30px;
}
/* 图片上传 */
.el-upload-dragger{
font-size: 28px;
color: #8c939d;
width: 136px;
height: 89px;
line-height: 45px;
text-align: center;
}
.page_addFD ._pic_upload .el-upload--text.el-upload, .page_fdd ._pic_upload .el-upload--text.el-upload, .page_addFD .el-upload-dragger, .page_fdd .el-upload-dragger {
font-size: 28px;
color: #8c939d;
width: 126px;
height: 80px;
line-height: 41px;
text-align: center;
}
.page_addFD ._pic_upload .el-upload--text.el-upload, .page_fdd ._pic_upload .el-upload--text.el-upload, .page_addFD .el-upload-dragger, .page_fdd .el-upload-dragger {
font-size: 28px;
color: #8c939d;
width: 126px;
height: 80px;
line-height: 41px;
text-align: center;
}
.queryul li span>em{display: inline-block; min-width: 80px; text-align: right; font-style: normal; margin:0 15px 0 0;}
This diff is collapsed.
@font-face{
font-family:'pingfang';
src:url('../fonts/pingfang.ttf') format('truetype')
}
@font-face {
font-family: "PingFangR";
src: url("../fonts/PingFangR.eot"); /* IE9 */
src: url("../fonts/PingFangR.eot?#iefix") format("embedded-opentype"), /* IE6-IE8 */
url("../fonts/PingFangR.woff") format("woff"), /* chrome, firefox */
url("../fonts/PingFangR.ttf") format("truetype"); /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */
}
@font-face {
font-family: "FZDBSJW";
src: url("../fonts/FZDBSJW.woff") format("woff"),
url("../fonts/FZDBSJW.TTF") format("truetype"),
url("../fonts/FZDBSJW.svg") format('svg');
font-style: normal;
font-weight: normal;
}
@font-face{
font-family:'方正大标宋简体';
src:url('../fonts/FZDBSJW.woff') format('woff')
}
@font-face{
font-family:'方正宋三简体';
src:url('../fonts/FZSSJ.ttf') format('truetype')
}
@font-face {
font-family: "PingFangSC";
src: url("../fonts/PingFangR.eot"); /* IE9 */
src: url("../fonts/PingFangR.eot?#iefix") format("embedded-opentype"), /* IE6-IE8 */
url("../fonts/PingFangR.woff") format("woff"), /* chrome, firefox */
url("../fonts/PingFangR.ttf") format("truetype"); /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */
font-style: normal;
font-weight: normal;
}
@font-face {
font-family: "PINGFANG";
src:url("../fonts/PingFangR.ttf") format("truetype"); /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */
font-style: normal;
font-weight: normal;
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
<template>
<div class="Materialwarehouse">
<ul class="queryul">
<li>
<span>
<em>仓库名称</em>
</span>
<el-input class="w200" size="small" v-model="msg.Name" placeholder="请输入"></el-input>
</li>
<el-button @click="addSupplier" size="small" type="danger">新增</el-button>
<el-button @click="getList" size="small">查询</el-button>
</ul>
<vxe-table style="margin-top:20px" :data="tableData" :loading="loading" size="small">
<vxe-table-column field="Name" title="仓库名称"></vxe-table-column>
<vxe-table-column field="UpdateBy" title="操作人"></vxe-table-column>
<vxe-table-column field="UpdateDate" title="操作时间"></vxe-table-column>
<vxe-table-column title="操作" width="120">
<template v-slot="{ row, rowIndex }">
<el-tooltip class="item" effect="dark" content="编辑" placement="top">
<i @click="Edit(row)" class="iconfont icon-xiugai"></i>
</el-tooltip>
<el-tooltip class="item" effect="dark" content="编辑" placement="top">
<i @click="Delete(row)" class="iconfont icon-shanchu"></i>
</el-tooltip>
</template>
</vxe-table-column>
</vxe-table>
<vxe-pager
:current-change="currentChange"
:current-page.sync="currentPage"
:page-size.sync="msg.pageSize"
:total="total"
align="center"
:layouts="['PrevJump', 'PrevPage', 'Jump', 'PageCount', 'NextPage', 'NextJump', 'Sizes', 'Total']">
</vxe-pager>
<el-dialog
:title="dialogtitle"
:visible.sync="dialogState"
width="30%">
<el-form :model="addMsg" :rules="rules" ref="addMsg" label-width="100px">
<el-form-item label="仓库名称" prop="Name">
<el-input v-model="addMsg.Name"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="submitForm('addMsg')">确定</el-button>
<el-button @click="dialogState=false">取消</el-button>
</el-form-item>
</el-form>
</el-dialog>
</div>
</template>
<script>
export default {
name: 'Materialwarehouse',
data(){
return{
currentPage:1,
tableData: [],
loading:false,
total:0,
msg:{
pageIndex:1,
pageSize:10,
Name:'',
},
addMsg:{
Id:0,
Name:'',
Contact:'',
Mobile:'',
},
dialogtitle:'新增仓库',
dialogState:false,
rules:{
Name: [
{ required: true, message: '请输入供应商名称', trigger: 'blur' }
]
},
}
},
mounted(){
this.getList();
},
methods:{
addSupplier(){
this.addMsg={
Id:0,
Name:''
}
this.dialogtitle="新增仓库";
this.dialogState=true;
},
submitForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
this.apiJavaPost("/api/Supplies/SetWareHouseInfo",this.addMsg,
res => {
if (res.data.resultCode === 1) {
this.getList();
this.Success(res.data.message)
this.dialogState=false;
} else {
this.Error(res.data.message);
}
},
null
);
} else {
return false;
}
});
},
currentChange(val) {
this.msg.pageIndex = val;
this.getList();
},
getList(){
this.loading=true;
this.apiJavaPost("/api/Supplies/GetWareHousePageList",this.msg,
res => {
this.loading=false;
if (res.data.resultCode === 1) {
console.log("res",res);
this.tableData=res.data.data.pageData;
this.total=res.data.data.count;
} else {
this.Error(res.data.message);
}
},
null
);
},
Edit(item){
this.dialogtitle="编辑仓库";
this.dialogState=true;
this.addMsg={
Id:item.Id,
Name:item.Name,
}
},
Delete(item){
let Id=item.Id;
this.$confirm("确认删除该仓库?","提示", {
confirmButtonText:"确定",
cancelButtonText: "取消",
type: 'warning'
}).then(() => {
this.apiJavaPost("/api/Supplies/DelWareHouseInfo",{WareHouseId:Id},
res => {
if (res.data.resultCode === 1) {
this.getList();
this.Success(res.data.message)
} else {
this.Error(res.data.message);
}
},
null
);
}).catch(() => {
this.$message.info('已取消删除!')
});
},
},
}
</script>
<style scoped>
</style>
This diff is collapsed.
<template>
<div class="Supplierman">
<ul class="queryul">
<li>
<span>
<em>供应商名称</em>
</span>
<el-input class="w200" size="small" v-model="msg.Name" placeholder="请输入"></el-input>
</li>
<li>
<span>
<em>联系人</em>
</span>
<el-input class="w200" size="small" v-model="msg.Contact" placeholder="请输入"></el-input>
</li>
<li>
<span>
<em>联系电话</em>
</span>
<el-input class="w200" size="small" v-model="msg.Mobile" placeholder="请输入"></el-input>
</li>
<el-button @click="addSupplier" size="small" type="danger">新增</el-button>
<el-button @click="getList" size="small">查询</el-button>
</ul>
<vxe-table style="margin-top:20px" :data="tableData" :loading="loading" size="small">
<vxe-table-column field="Name" title="供应商名称"></vxe-table-column>
<vxe-table-column field="Contact" title="联系人"></vxe-table-column>
<vxe-table-column field="Mobile" title="联系电话"></vxe-table-column>
<vxe-table-column field="UpdateBy" title="操作人"></vxe-table-column>
<vxe-table-column field="UpdateDate" title="操作时间"></vxe-table-column>
<vxe-table-column title="操作" width="120">
<template v-slot="{ row, rowIndex }">
<el-tooltip class="item" effect="dark" content="编辑" placement="top">
<i @click="Edit(row)" class="iconfont icon-xiugai"></i>
</el-tooltip>
<el-tooltip class="item" effect="dark" content="编辑" placement="top">
<i @click="Delete(row)" class="iconfont icon-shanchu"></i>
</el-tooltip>
</template>
</vxe-table-column>
</vxe-table>
<vxe-pager
:current-change="currentChange"
:current-page.sync="currentPage"
:page-size.sync="msg.pageSize"
:total="total"
align="center"
:layouts="['PrevJump', 'PrevPage', 'Jump', 'PageCount', 'NextPage', 'NextJump', 'Sizes', 'Total']">
</vxe-pager>
<el-dialog
:title="dialogtitle"
:visible.sync="dialogState"
width="30%">
<el-form :model="addMsg" :rules="rules" ref="addMsg" label-width="100px">
<el-form-item label="供应商名称" prop="Name">
<el-input v-model="addMsg.Name"></el-input>
</el-form-item>
<el-form-item label="联系人" prop="Contact">
<el-input v-model="addMsg.Contact"></el-input>
</el-form-item>
<el-form-item label="联系电话" prop="Mobile">
<el-input v-model="addMsg.Mobile"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="submitForm('addMsg')">确定</el-button>
<el-button @click="dialogState=false">取消</el-button>
</el-form-item>
</el-form>
</el-dialog>
</div>
</template>
<script>
export default {
name: 'Supplierman',
data(){
return{
currentPage:1,
tableData: [],
loading:false,
total:0,
msg:{
pageIndex:1,
pageSize:10,
Name:'',
Contact:'',
Mobile:'',
},
addMsg:{
Id:0,
Name:'',
Contact:'',
Mobile:'',
},
dialogtitle:'新增',
dialogState:false,
rules:{
Name: [
{ required: true, message: '请输入供应商名称', trigger: 'blur' }
],
Contact: [
{ required: true, message: '请输入联系人', trigger: 'blur' }
],
Mobile: [
{ required: true, message: '请输入联系电话', trigger: 'blur' },
{required: true,pattern: /^(0|86|17951)?(13[0-9]|15[012356789]|17[012356789]|18[0-9]|19[0-9]|14[57])[0-9]{8}$/,message: '请输入正确的联系电话'}
],
},
}
},
mounted(){
this.getList();
},
methods:{
addSupplier(){
this.addMsg={
Id:0,
Name:'',
Contact:'',
Mobile:'',
}
this.dialogtitle="新增";
this.dialogState=true;
},
submitForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
this.apiJavaPost("/api/property/SetSupplierInfo",this.addMsg,
res => {
if (res.data.resultCode === 1) {
this.getList();
this.Success(res.data.message)
this.dialogState=false;
} else {
this.Error(res.data.message);
}
},
null
);
} else {
return false;
}
});
},
currentChange(val) {
this.msg.pageIndex = val;
this.getList();
},
getList(){
this.loading=true;
this.apiJavaPost("/api/property/GetSupplierPageList",this.msg,
res => {
this.loading=false;
if (res.data.resultCode === 1) {
console.log("res",res);
this.tableData=res.data.data.pageData;
this.total=res.data.data.count;
} else {
this.Error(res.data.message);
}
},
null
);
},
Edit(item){
this.dialogtitle="编辑";
this.dialogState=true;
this.addMsg={
Id:item.Id,
Name:item.Name,
Contact:item.Contact,
Mobile:item.Mobile,
}
},
Delete(item){
let Id=item.Id;
this.$confirm("确认删除该供应商?","提示", {
confirmButtonText:"确定",
cancelButtonText: "取消",
type: 'warning'
}).then(() => {
this.apiJavaPost("/api/property/DelSupplierInfo",{SupplierId:Id},
res => {
if (res.data.resultCode === 1) {
this.getList();
this.Success(res.data.message)
} else {
this.Error(res.data.message);
}
},
null
);
}).catch(() => {
this.$message.info('已取消删除!')
});
},
},
}
</script>
<style scoped>
</style>
This diff is collapsed.
<template>
<div class="login">
<el-input v-model="userInfo.EmAccount" placeholder="请输入内容"></el-input>
<el-input v-model="userInfo.EmPassword" placeholder="请输入内容"></el-input>
<el-button @click="Login">登录</el-button>
</div>
</template>
<script>
export default {
name: 'login',
data(){
return{
userInfo:{
EmAccount:'',
EmPassword:'',
Domain:'',
},
}
},
mounted(){
this.initData();
},
methods:{
initData() {
//判断是否是线上环境
if (!this.isOnline()) {
this.userInfo.EmAccount = "18117845617";
this.userInfo.EmPassword = "123456";
}
this.userInfo.Domain = window.location.hostname
},
Login(){
if (this.userInfo.EmAccount == "") {
this.nameIsShow = true;
this.Error("请输入用户名");
return;
} else if (this.userInfo.EmPassword == "") {
this.passwordIsShow = true;
this.Error("请输入密码");
return;
}
this.apiJavaPost("/api/login/userlogin",this.userInfo,
res => {
if (res.data.resultCode === 1) {
let user=res.data.data;
var userJson = JSON.stringify(user);
localStorage.zcuserInfo = userJson;
this.$router.push({path: 'Home'})
} else {
this.Error(res.data.message);
}
},
null
);
},
},
}
</script>
<style>
</style>
<template>
<div class="HeadNav">
<div style="text-align:center;padding-top:30px">
<img style="width:42px;height:42px;" src="../../assets/img/logo.png" alt="">
</div>
<div style="margin-top:60px">
<el-menu
@select="selectActive"
:default-active="defaulActive"
class="el-menu-vertical-demo">
<el-menu-item index="0" route="/home">
<div class="menuDiv">
<img v-if="defaulActive!=0" class="icon" src="../../assets/img/home.png" alt="">
<img v-if="defaulActive==0" class="icon" src="../../assets/img/home1.png" alt="">
<span slot="title">首页</span>
</div>
</el-menu-item>
<el-submenu index="1">
<template slot="title">
<div class="menuDiv">
<img v-if="defaulActive!=1" class="icon" src="../../assets/img/zc1.png" alt="">
<img v-if="defaulActive==1" class="icon" src="../../assets/img/zc.png" alt="">
<span>资产管理</span>
</div>
</template>
<el-menu-item-group class="itemgroup">
<el-menu-item index="1-1"><span>资产列表</span></el-menu-item>
<el-menu-item index="1-2"><span>选项2</span></el-menu-item>
</el-menu-item-group>
</el-submenu>
<el-submenu index="2">
<template slot="title">
<div class="menuDiv">
<img v-if="defaulActive!=2" class="icon" src="../../assets/img/hc.png" alt="">
<img v-if="defaulActive==2" class="icon" src="../../assets/img/hc1.png" alt="">
<span slot="title">耗材管理</span>
</div>
</template>
<el-menu-item-group class="itemgroup">
<el-menu-item index="2-1"><span>物料仓库</span></el-menu-item>
<el-menu-item index="2-2"><span>物料档案</span></el-menu-item>
</el-menu-item-group>
</el-submenu>
<el-submenu index="3">
<template slot="title">
<div class="menuDiv">
<img v-if="defaulActive=='3-1' || defaulActive=='3-2' || defaulActive=='3-3'" class="icon icon1" src="../../assets/img/xt1.png" alt="">
<img v-else class="icon" src="../../assets/img/xt.png" alt="">
<span slot="title">系统管理</span>
</div>
</template>
<el-menu-item-group class="itemgroup">
<el-menu-item index="3-1"><span>资产分类</span></el-menu-item>
<el-menu-item index="3-2"><span>耗材分类</span></el-menu-item>
<el-menu-item index="3-3"><span>供应商管理</span></el-menu-item>
</el-menu-item-group>
</el-submenu>
<el-menu-item index="4">
<div class="menuDiv">
<img v-if="defaulActive!='4'" class="icon" src="../../assets/img/sp.png" alt="">
<img v-if="defaulActive=='4'" class="icon" src="../../assets/img/sp1.png" alt="">
<span slot="title">审批中心</span>
</div>
</el-menu-item>
</el-menu>
</div>
</div>
</template>
<script>
export default {
name: '',
data(){
return{
defaulActive:'0',
route:{
'0':'/home',
'1':'/home',
'1-1':'/assetsList',
'2-1':'/Materialwarehouse',
'2-2':'/Archivesmaterials',
'3-1':'/AssetsClassification',
'3-3':'/Supplierman',
},
}
},
methods:{
selectActive(val){
this.defaulActive=val;
console.log("defaulActive",this.defaulActive)
console.log("route",this.route[val])
this.$router.push({path: this.route[val]})
},
handleOpen(key, keyPath) {
console.log(key, keyPath);
},
handleClose(key, keyPath) {
console.log(key, keyPath);
}
},
}
</script>
<style>
.HeadNav .el-menu>.is-active .menuDiv{
width:146px;
height:34px;
line-height:34px;
background:rgba(17,17,17,1);
border-radius:17px;
color:#fff;
}
.HeadNav .icon{
width: 12px;
height: 12px;
margin-right: 19px;
}
.HeadNav .el-menu{
border: none;
}
.HeadNav .el-submenu__title i{
color: #111111;
font-weight: bold;
font-size: 10px;
}
.HeadNav .el-submenu__title{
color: #111111;
font-size: 12px;
}
.HeadNav .el-menu-item{
color: #111111;
font-size: 12px;
}
.HeadNav .el-menu-item .menuDiv,.HeadNav .el-submenu .menuDiv{
padding-left:25px;
}
.HeadNav .el-menu-item.is-active .menuDiv{
width:146px;
height:34px;
line-height:34px;
background:rgba(17,17,17,1);
border-radius:17px;
color:#fff;
}
.HeadNav .el-menu-item:focus,.HeadNav .el-menu-item:hover{
background: transparent;
}
.HeadNav .el-submenu__title:hover{
background: transparent;
}
.HeadNav .el-menu-item, .HeadNav .el-submenu__title{
height:34px;
line-height:34px;
margin-bottom:20px;
}
.HeadNav .itemgroup{
margin-top: -30px;
}
.HeadNav .itemgroup .el-menu-item.is-active{
color:#111111!important;
}
.HeadNav .itemgroup .el-menu-item{
margin-bottom: 15px!important;
color: rgba(164, 188, 188, 1);
}
.HeadNav .itemgroup .el-menu-item span{
padding-left: 40px;
}
</style>
<template>
<div class="App">
<div class="nav">
<Nav></Nav>
</div>
<div class="appContent">
<!-- 头部 -->
<div class="HeadDiv" style="padding-top:20px">
<div class="searchDiv">
<img style="width:20px;height:20px" src="../../assets/img/search.png" alt="">
<input type="text" placeholder="请输入关键词搜索">
</div>
<div class="personDiv">
<img style="width:18px;height:22px" src="../../assets/img/news.png" alt="">
<span style="margin-left:30px" class="f14"><span style="color:#BEBEBE">Hello</span>,{{zcuserInfo.emName}}</span>
<img v-if="zcuserInfo.GroupPic!='' " :src="zcuserInfo.GroupPic" :onerror="defaultHeadImg" style="width:44px;height:44px;margin-left:29px" alt="">
</div>
</div>
<div class="routerContent" :style='{"min-height":minHeight+"px"}'>
<router-view/>
</div>
</div>
</div>
</template>
<script>
import Nav from '@/components/global/Nav.vue'
export default {
name: 'App',
components: {
Nav,
},
data(){
return{
minHeight:0,
zcuserInfo:{},
defaultHeadImg:
'this.src="' + require("../../assets/img/defaultperson.png") + '"',
}
},
created(){
this.minHeight=document.body.clientHeight-70;
let zcuserInfo = this.getLocalStorage();
this.zcuserInfo=zcuserInfo;
if (this.$route.name === 'index') {
this.$router.push({path: 'Home'})
}
},
}
</script>
<style>
@import "../../assets/css/reset.css";
.appContent .routerContent{
padding-top: 70px;
position: relative;
box-sizing: border-box;
}
.nav{
position: fixed;
width: 204px;
top:0;
left: 0;
height: 100%;
}
.appContent .HeadDiv{
position: absolute;
width: calc(100% - 214px);
top: 0;
}
.appContent{
width: 100%;
padding-left: 214px;
box-sizing: border-box;
position: relative;
}
.searchDiv{
margin-left: 20px;
display: inline-flex;
width:438px;
height:46px;
background:rgba(247,248,250,1);
border-radius:23px;
align-items: center;
padding-left: 30px;
box-sizing: border-box;
}
.searchDiv input{
border:none;
width: 380px;
height: 100%;
outline: none;
background:transparent;
padding-left: 30px;
box-sizing: border-box;
}
.searchDiv input::-webkit-input-placeholder { /* WebKit, Blink, Edge */
color:rgba(190, 193, 198, 1)
}
.searchDiv input:-moz-placeholder { /* Mozilla Firefox 4 ~ 18 */
color:rgba(190, 193, 198, 1)
}
.searchDiv input::-moz-placeholder { /* Mozilla Firefox 19+ */
color:rgba(190, 193, 198, 1)
}
.searchDiv input:-ms-input-placeholder { /* Internet Explorer 10 ~ 11 */
color:rgba(190, 193, 198, 1)
}
.searchDiv input::placeholder { /* 大部分现代浏览器 */
color:rgba(190, 193, 198, 1)
}
.personDiv{
float: right;
display: inline-flex;
align-items: center;
padding-right: 30px;
}
</style>
// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import plug from './plugins/index'
import moment from 'moment'
import axios from 'axios'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import echarts from 'echarts'
Vue.prototype.$echarts = echarts
import 'xe-utils'
import VXETable from 'vxe-table'
import 'vxe-table/lib/index.css'
Vue.use(VXETable)
Vue.use(ElementUI);
Vue.use(plug)
Vue.config.productionTip = false
Vue.http = Vue.prototype.$http = axios
Vue.filter("YMD", function (date) {
return moment(date).format("YYYY-MM-DD");
})
Vue.filter("MD", function (date) {
return moment(date).format("MM月DD日");
})
Vue.filter("YMDHMS", function (date) {
return moment(date).format("YYYY-MM-DD HH:mm:ss");
})
/* eslint-disable no-new */
new Vue({
el: '#app',
router,
components: { App },
template: '<App/>'
})
This diff is collapsed.
import Home from '../components/Home'
import Login from '../components/global/Login'
import index from '../components/global/index'
export default {
routes: [
{
path: '/login',
name: 'Login',
component: Login
},
{
path: '/',
name: 'Login',
component: Login
},
{
path: '/index',
name: 'index',
component: index,
meta: {
title: '首页'
},
children: [
{
path: '/Home',
name: 'Home',
component: Home
},
{
path: '/AssetsClassification',
name: 'AssetsClassification',
component: resolve => require(['@/components/Systemman/AssetsClassification'], resolve),
},
{
path: '/Supplierman',
name: 'Supplierman',
component: resolve => require(['@/components/Systemman/Supplierman'], resolve),
},
{
path: '/assetsList',
name: 'assetsList',
component: resolve => require(['@/components/assetsman/assetsList'], resolve),
},
// 物料仓库
{
path: '/Materialwarehouse',
name: 'Materialwarehouse',
component: resolve => require(['@/components/Materialman/Materialwarehouse'], resolve),
},
// 物料档案
{
path: '/Archivesmaterials',
name: 'Archivesmaterials',
component: resolve => require(['@/components/Materialman/Archivesmaterials'], resolve),
},
]
},
// {
// path: '/supplierIndex', //供应商首页
// name: 'supplierIndex',
// component: supplierIndex,
// children: [
// {
// path: '/leaderPrint',
// name: 'leaderPrint',
// component: resolve => require(['@/components/leaderPrint'], resolve),
// },
// ]
// },
]
}
\ No newline at end of file
import Vue from 'vue'
import Router from 'vue-router'
import routerConfig from '../router/config'
const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err)
}
Vue.use(Router)
export default new Router({
routes:routerConfig.routes
})
// A custom Nightwatch assertion.
// The assertion name is the filename.
// Example usage:
//
// browser.assert.elementCount(selector, count)
//
// For more information on custom assertions see:
// http://nightwatchjs.org/guide#writing-custom-assertions
exports.assertion = function (selector, count) {
this.message = 'Testing if element <' + selector + '> has count: ' + count
this.expected = count
this.pass = function (val) {
return val === this.expected
}
this.value = function (res) {
return res.value
}
this.command = function (cb) {
var self = this
return this.api.execute(function (selector) {
return document.querySelectorAll(selector).length
}, [selector], function (res) {
cb.call(self, res)
})
}
}
require('babel-register')
var config = require('../../config')
// http://nightwatchjs.org/gettingstarted#settings-file
module.exports = {
src_folders: ['test/e2e/specs'],
output_folder: 'test/e2e/reports',
custom_assertions_path: ['test/e2e/custom-assertions'],
selenium: {
start_process: true,
server_path: require('selenium-server').path,
host: '127.0.0.1',
port: 4444,
cli_args: {
'webdriver.chrome.driver': require('chromedriver').path
}
},
test_settings: {
default: {
selenium_port: 4444,
selenium_host: 'localhost',
silent: true,
globals: {
devServerURL: 'http://localhost:' + (process.env.PORT || config.dev.port)
}
},
chrome: {
desiredCapabilities: {
browserName: 'chrome',
javascriptEnabled: true,
acceptSslCerts: true
}
},
firefox: {
desiredCapabilities: {
browserName: 'firefox',
javascriptEnabled: true,
acceptSslCerts: true
}
}
}
}
// 1. start the dev server using production config
process.env.NODE_ENV = 'testing'
const webpack = require('webpack')
const DevServer = require('webpack-dev-server')
const webpackConfig = require('../../build/webpack.prod.conf')
const devConfigPromise = require('../../build/webpack.dev.conf')
let server
devConfigPromise.then(devConfig => {
const devServerOptions = devConfig.devServer
const compiler = webpack(webpackConfig)
server = new DevServer(compiler, devServerOptions)
const port = devServerOptions.port
const host = devServerOptions.host
return server.listen(port, host)
})
.then(() => {
// 2. run the nightwatch test suite against it
// to run in additional browsers:
// 1. add an entry in test/e2e/nightwatch.conf.js under "test_settings"
// 2. add it to the --env flag below
// or override the environment flag, for example: `npm run e2e -- --env chrome,firefox`
// For more information on Nightwatch's config file, see
// http://nightwatchjs.org/guide#settings-file
let opts = process.argv.slice(2)
if (opts.indexOf('--config') === -1) {
opts = opts.concat(['--config', 'test/e2e/nightwatch.conf.js'])
}
if (opts.indexOf('--env') === -1) {
opts = opts.concat(['--env', 'chrome'])
}
const spawn = require('cross-spawn')
const runner = spawn('./node_modules/.bin/nightwatch', opts, { stdio: 'inherit' })
runner.on('exit', function (code) {
server.close()
process.exit(code)
})
runner.on('error', function (err) {
server.close()
throw err
})
})
// For authoring Nightwatch tests, see
// http://nightwatchjs.org/guide#usage
module.exports = {
'default e2e tests': function (browser) {
// automatically uses dev Server port from /config.index.js
// default: http://localhost:8080
// see nightwatch.conf.js
const devServer = browser.globals.devServerURL
browser
.url(devServer)
.waitForElementVisible('#app', 5000)
.assert.elementPresent('.hello')
.assert.containsText('h1', 'Welcome to Your Vue.js App')
.assert.elementCount('img', 1)
.end()
}
}
{
"env": {
"jest": true
},
"globals": {
}
}
const path = require('path')
module.exports = {
rootDir: path.resolve(__dirname, '../../'),
moduleFileExtensions: [
'js',
'json',
'vue'
],
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1'
},
transform: {
'^.+\\.js$': '<rootDir>/node_modules/babel-jest',
'.*\\.(vue)$': '<rootDir>/node_modules/vue-jest'
},
testPathIgnorePatterns: [
'<rootDir>/test/e2e'
],
snapshotSerializers: ['<rootDir>/node_modules/jest-serializer-vue'],
setupFiles: ['<rootDir>/test/unit/setup'],
mapCoverage: true,
coverageDirectory: '<rootDir>/test/unit/coverage',
collectCoverageFrom: [
'src/**/*.{js,vue}',
'!src/main.js',
'!src/router/index.js',
'!**/node_modules/**'
]
}
import Vue from 'vue'
Vue.config.productionTip = false
import Vue from 'vue'
import HelloWorld from '@/components/HelloWorld'
describe('HelloWorld.vue', () => {
it('should render correct contents', () => {
const Constructor = Vue.extend(HelloWorld)
const vm = new Constructor().$mount()
expect(vm.$el.querySelector('.hello h1').textContent)
.toEqual('Welcome to Your Vue.js App')
})
})
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment