Commit 5dfc4c7a by xmh

'提交'

0 parents
{
"presets": [
["env", {
"modules": false,
"targets": {
"browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
}
}],
"stage-2"
],
"plugins": ["transform-vue-jsx", "transform-runtime"]
}
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*
# 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": {}
}
}
<<<<<<< HEAD
# finance_serv
=======
# contractManagementSystem
>>>>>>> df45bcf516c15bdfd4d93ed5c68fed43c156b7a6
> 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).
<<<<<<< HEAD
=======
## others
This is my first work after graduating from college.This is my first contract with Vue,JS,CSS and Element-ui.So,as you see,the code is too poor and too fat.I need time to make my code better.
>>>>>>> df45bcf516c15bdfd4d93ed5c68fed43c156b7a6
'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',
publicPath:'../../'
})
} else {
return ['vue-style-loader'].concat(loaders)
}
}
// https://vue-loader.vuejs.org/en/configurations/extract-css.html
return {
css: generateLoaders(),
postcss: generateLoaders(),
less: generateLoaders('less'),
sass: generateLoaders('sass', { indentedSyntax: true }),
scss: generateLoaders('sass'),
stylus: generateLoaders('stylus'),
styl: generateLoaders('stylus')
}
}
// Generate loaders for standalone style files (outside of .vue)
exports.styleLoaders = function (options) {
const output = []
const loaders = exports.cssLoaders(options)
for (const extension in loaders) {
const loader = loaders[extension]
output.push({
test: new RegExp('\\.' + extension + '$'),
use: loader
})
}
return output
}
exports.createNotifierCallback = () => {
const notifier = require('node-notifier')
return (severity, errors) => {
if (severity !== 'error') return
const error = errors[0]
const filename = error.file && error.file.split('!').pop()
notifier.notify({
title: packageConfig.name,
message: severity + ': ' + error.name,
subtitle: filename || '',
icon: path.join(__dirname, 'logo.png')
})
}
}
'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:['babel-polyfill','./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]')
}
},
{
test: /\\\\\\\\.css$/,
loader: "style!css"
},
{
test: /\\\\\\\\.(eot|woff|woff2|ttf)([\\\\\\\\?]?.*)$/,
loader: "file"
}
]
},
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 = 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
'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: {},
// Various Dev Server settings
host: 'localhost', // can be overwritten by process.env.HOST
port: 8888, // 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"'
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="shortcut icon" type="image/x-icon" href="static/favicon.ico">
<title>合同管理系统</title>
<style>
input:focus,
textarea:focus {
background-color: papayawhip;
}
</style>
</head>
<body style="height: 100%;margin: 0">
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
This diff could not be displayed because it is too large.
{
"name": "finance_serv",
"version": "1.0.0",
"description": "A Vue.js project",
"author": "xmh",
"private": true,
"scripts": {
"dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
"start": "npm run dev",
"build": "node build/build.js"
},
"dependencies": {
"axios": "^0.18.0",
"element-ui": "^2.4.4",
"numeral": "^2.0.6",
"pinyin": "^2.8.3",
"style-loader": "^0.21.0",
"vue": "^2.5.2",
"vue-router": "^3.0.1",
"vuex": "^3.0.1"
},
"devDependencies": {
"autoprefixer": "^7.1.2",
"babel-core": "^6.22.1",
"babel-helper-vue-jsx-merge-props": "^2.0.3",
"babel-loader": "^7.1.1",
"babel-plugin-syntax-jsx": "^6.18.0",
"babel-plugin-transform-runtime": "^6.22.0",
"babel-plugin-transform-vue-jsx": "^3.5.0",
"babel-polyfill": "^6.26.0",
"babel-preset-env": "^1.3.2",
"babel-preset-stage-2": "^6.22.0",
"chalk": "^2.0.1",
"copy-webpack-plugin": "^4.0.1",
"css-loader": "^0.28.11",
"extract-text-webpack-plugin": "^3.0.0",
"file-loader": "^1.1.11",
"friendly-errors-webpack-plugin": "^1.6.1",
"html-webpack-plugin": "^2.30.1",
"mockjs": "^1.0.1-beta3",
"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",
"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 id="app">
<router-view></router-view>
</div>
</template>
<script>
export default {
name: "App",
methods: {},
data() {
return {};
}
};
</script>
.el-container{
}
<style>
html,
body,
#app {
min-height: 700px;
height: 100%;
}
</style>
@font-face {font-family: "icon";
src: url('iconfont.eot?t=1536052905420'); /* IE9*/
src: url('iconfont.eot?t=1536052905420#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('data:application/x-font-woff;charset=utf-8;base64,d09GRgABAAAAAAp0AAsAAAAADyQAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADMAAABCsP6z7U9TLzIAAAE8AAAARAAAAFY8hUnVY21hcAAAAY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cmkpEPcSy6srRR5snPqkPq93pPz84YXYAAHicbYhRDsIgEAX3VQraqkkPwqEIYCVpWLJQibc3auKX8zOZoYG+TPSfGQMOUBihYXDECRNmnMk4Ee57uX4cuGfruTzHjdeUTY2tpbyqvUZRt7RFnYJ3EnSNTvx9Ka7WzhJs5mYfKfbL77yL6AXHAyMlAAAA') format('woff'),
url('iconfont.ttf?t=1536052905420') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
url('iconfont.svg?t=1536052905420#icon') format('svg'); /* iOS 4.1- */
}
.icon {
font-family:"icon" !important;
font-size:16px;
font-style:normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.i-arrowup:before { content: "\e60f"; }
.i-arrowdown-copy:before { content: "\e623"; }
.i-login:before { content: "\e78d"; }
.i-setting:before { content: "\e78e"; }
.i-user:before { content: "\e7ae"; }
.i-file:before { content: "\e7bb"; }
.i-idcard:before { content: "\e7de"; }
.i-search:before { content: "\e7e3"; }
.i-password-not-view:before { content: "\e723"; }
.i-password-view:before { content: "\e724"; }
No preview for this file type
No preview for this file type
No preview for this file type
This diff could not be displayed because it is too large.
<template>
<transition name="logo-fade">
<div style="align:center" v-show="show">
<span style="font-size:100px;margin-top:15%;margin-bottom:0;margin-left:auto;margin-right:auto;background-color:black;color:white;width:622px;display:block">合同管理系统</span>
<img src="../assets/logo.png" alt="">
</div>
</transition>
</template>
<script>
export default {
data() {
return {
show: false
};
},
mounted() {
this.show = true;
}
};
</script>
<style scoped>
.logo-fade-enter-active {
transition: all 3.5s ease;
}
.logo-fade-enter {
opacity: 0;
}
</style>
<template>
<el-container id="nav">
<el-aside width="10%" style="background-color:black;position:relative">
<el-menu :default-active="$route.path" class="el-menu-vertical-demo" router :collapse="false" text-color="white" background-color="rgba(0,0,0,0)" active-text-color="#ffd04b">
<div style="height:20%;text-align:center">
<img src="../assets/logo.png" alt="" style="width:100%;height:26%">
</div>
<el-menu-item index="/nav/search">
<i class="icon i-search"></i>
<span slot="title">检索合同</span>
</el-menu-item>
<el-menu-item index="/nav/contract/0" @click="contract" v-if="contract_show">
<i class="icon i-file"></i>
<span slot="title">合同信息</span>
</el-menu-item>
<el-menu-item index="/nav/user">
<i class="icon i-user"></i>
<span slot="title">个人管理</span>
</el-menu-item>
<el-menu-item index="/nav/manage" v-show="management">
<i class="icon i-setting"></i>
<span slot="title">后台管理</span>
</el-menu-item>
<el-menu-item index="" @click="exit">
<i class="icon i-login"></i>
<span slot="title">退出</span>
</el-menu-item>
</el-menu>
<div class="poem">
<div class="content" v-for="(item,index) in poem.sentences" :key="index" v-if="item">
{{item}}
</div>
<div class="content" v-if="poem.author">
丨丨{{poem.author}}
</div>
</div>
</el-aside>
<el-main :style="color">
<keep-alive include="search">
<router-view></router-view>
</keep-alive>
</el-main>
</el-container>
</template>
<script>
export default {
name: "HelloWorld",
data() {
return {
poem: {
author: "",
sentences: [,]
},
color: "background-color: lightblue",
management: false,
username: "",
department: "",
collapse: true,
contract_show: true
};
},
methods: {
contract() {
if (sessionStorage.getItem("modify")) {
sessionStorage.removeItem("modify");
}
},
exit() {
this.$confirm("确认退出?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
sessionStorage.clear();
this.$router.push({ path: "/" });
})
.catch(() => {});
},
get_poem() {
this.$Axios.get("https://api.gushi.ci/all.json").then(res => {
this.poem = res.data;
console.log(this.poem.content);
var reg = /[。;、,?!]/;
var a = this.poem.content.split(reg);
this.poem.sentences = a;
});
}
},
beforeCreate() {
if (!sessionStorage.getItem("login_check")) {
alert("请登录");
this.$router.push({ path: "/" });
}
},
created() {
if (
sessionStorage.getItem("user_roles") != "null" &&
sessionStorage.getItem("user_roles")
) {
var roles = JSON.parse(sessionStorage.getItem("user_roles"));
for (let i = 0; i < roles.length; i++) {
const e = roles[i];
if (e.role_unid == "91d5185d47e3bad099e17570b0dd0ed2") {
this.management = true;
}
}
} else {
this.contract_show = false;
}
if (sessionStorage.getItem("user_name") === "Admin") {
this.management = true;
}
if (sessionStorage.getItem("manager")) {
this.management = true;
this.contract_show = true;
}
if (localStorage.getItem("color")) {
var style = {};
switch (localStorage.getItem("color")) {
case "天空蓝":
this.color = "background-color: lightblue";
style.color = "lightblue";
style.image = null;
break;
case "梦幻紫":
this.color =
"background-color:#8ec5fc;background-image:linear-gradient(225deg, #8ec5fc 0%, #e0c3fc 100%)";
style.color = "#8ec5fc";
style.image = "linear-gradient(225deg, #8ec5fc 0%, #e0c3fc 100%)";
break;
case "活力橙":
this.color =
"background-color:#FBAB7E;background-image:linear-gradient(62deg, #FBAB7E 0%, #F7CE68 100%)";
style.color = "#FBAB7E";
style.image = "linear-gradient(62deg, #FBAB7E 0%, #F7CE68 100%)";
break;
case "柠檬绿":
this.color =
"background-color:#F4D03F;background-image:linear-gradient(71deg, #F4D03F 0%, #16a046 92%)";
style.color = "#F4D03F";
style.image = "linear-gradient(71deg, #F4D03F 0%, #16a046 92%)";
break;
case "灰灰灰":
this.color = "background-color:#f0f0f0";
style.color = "#f0f0f0";
style.image = null;
break;
case "小清新":
this.color =
"background-color:#FFDEE9;background-image:linear-gradient(0deg, #FFDEE9 0%, #B5FFFC 100%)";
style.color = "#FFDEE9";
style.image = "linear-gradient(0deg, #FFDEE9 0%, #B5FFFC 100%)";
break;
}
localStorage.setItem("style", JSON.stringify(style));
}
},
mounted() {
// this.get_poem();
}
};
</script>
<style>
.el-container > .el-main {
min-width: 1120px;
text-align: center;
padding: 0;
overflow-y: scroll;
}
.el-container,
.el-aside {
min-width: 167px;
height: 100%;
}
.el-aside > .el-menu {
height: 100%;
}
.poem {
position: absolute;
margin: auto;
left: 15px;
bottom: 50px;
}
.content {
font-family: "隶书";
color: white;
display: inline-block;
width: 25px;
font-size: 20px;
line-height: 24px;
overflow: hidden;
word-wrap: break-word;
}
</style>
<template>
<div id="user_wrapper">
<el-card class="box-card" id="user" shadow="hover" style="width: 30%">
<div slot="header" style="text-align: center" class="clearfix">
<span style="font-size: 24px; color: #eff0dc">修改密码</span>
</div>
<el-form
ref="password_form"
:model="password_form"
:rules="password_form_rules"
label-width="60px"
label-position="top"
>
<el-form-item prop="odd_password">
<el-input
:type="odd_password_type"
v-model="password_form.odd_password"
auto-complete="off"
>
<template slot="prepend">原密码</template>
<el-button
class="append_button"
slot="append"
:icon="odd_password_view"
@click="show_odd_password"
></el-button>
</el-input>
</el-form-item>
<el-form-item prop="new_password">
<el-input
:type="new_password_type"
v-model="password_form.new_password"
auto-complete="off"
>
<template slot="prepend">新密码</template>
<el-button
class="append_button"
slot="append"
:icon="new_password_view"
@click="show_new_password"
></el-button>
</el-input>
</el-form-item>
<el-form-item prop="check_password">
<el-input
:type="new_password_type"
v-model="password_form.check_password"
auto-complete="off"
>
<template slot="prepend">新密码</template>
<el-button
class="append_button"
slot="append"
:icon="new_password_view"
@click="show_new_password"
></el-button>
</el-input>
</el-form-item>
<el-form-item>
<el-button-group>
<el-button type="primary" @click="submitForm('password_form')"
>提交</el-button
>
<el-button type="warning" @click="resetForm('password_form')"
>重置</el-button
>
</el-button-group>
</el-form-item>
</el-form>
</el-card>
<el-card class="box-card" id="user" shadow="hover" style="width: 30%">
<div slot="header" style="text-align: center" class="clearfix">
<span style="font-size: 24px; color: #eff0dc">主题颜色</span>
</div>
<el-radio-group v-model="color" @change="change_color">
<el-row style="padding-bottom: 1px">
<el-radio-button label="天空蓝"></el-radio-button>
<el-radio-button label="梦幻紫"></el-radio-button>
<el-radio-button label="活力橙"></el-radio-button>
</el-row>
<el-row>
<el-radio-button label="柠檬绿"></el-radio-button>
<el-radio-button label="灰灰灰"></el-radio-button>
<el-radio-button label="小清新"></el-radio-button>
</el-row>
</el-radio-group>
</el-card>
</div>
</template>
<script>
export default {
name: "user",
data() {
return {
color: "天空蓝",
new_password_type: "password",
odd_password_type: "password",
new_password_view: "icon i-password-not-view",
odd_password_view: "icon i-password-not-view",
rtoken: "",
user_unid: "",
auth_base_url: this.$disparch_data.auth_base_url,
password_form: {
odd_password: "",
new_password: "",
check_password: "",
},
password_form_rules: {
odd_password: {
required: true,
message: "请填写旧密码",
trigger: "blur",
},
new_password: [
{
pattern: /^[A-Za-z0-9\x20-\x7f]{6,16}$/,
message: "密码至少6位,至多16位",
trigger: "blur",
},
{
required: true,
message: "必须填写新密码",
trigger: "blur",
},
{
validator: (rule, value, callback) => {
if (value == this.password_form.odd_password) {
callback(new Error("新密码不能和旧密码相同"));
} else callback();
},
trigger: "blur",
},
],
check_password: [
{
pattern: /^[A-Za-z0-9\x20-\x7f]{6,16}$/,
message: "密码至少6位,至多16位",
trigger: "blur",
},
{
required: true,
message: "必须填写新密码",
trigger: "blur",
},
{
validator: (rule, value, callback) => {
if (value != this.password_form.new_password) {
callback(new Error("两次输入不一致"));
} else callback();
},
trigger: "blur",
},
],
},
};
},
methods: {
change_color() {
var backgroundColor = "none";
var backgroundImage = "none";
switch (this.color) {
case "天空蓝":
backgroundColor = "lightblue";
break;
case "梦幻紫":
backgroundColor = "#8ec5fc";
backgroundImage = "linear-gradient(225deg, #8ec5fc 0%, #e0c3fc 100%)";
break;
case "活力橙":
backgroundColor = "#FBAB7E";
backgroundImage = "linear-gradient(62deg, #FBAB7E 0%, #F7CE68 100%)";
break;
case "柠檬绿":
backgroundColor = "#F4D03F";
backgroundImage = "linear-gradient(71deg, #F4D03F 0%, #16a046 92%)";
break;
case "灰灰灰":
backgroundColor = "#f0f0f0";
break;
case "小清新":
backgroundColor = "#FFDEE9";
backgroundImage = "linear-gradient(0deg, #FFDEE9 0%, #B5FFFC 100%)";
break;
}
let main = document.getElementsByClassName("el-main")[0];
main.style["background-color"] = backgroundColor;
main.style.backgroundImage = backgroundImage;
localStorage.setItem("color", this.color);
this.$router.go(0);
},
show_odd_password() {
if (this.odd_password_type == "password") {
this.odd_password_type = "text";
this.odd_password_view = "icon i-password-view";
} else {
this.odd_password_type = "password";
this.odd_password_view = "icon i-password-not-view";
}
},
show_new_password() {
if (this.new_password_type == "password") {
this.new_password_type = "text";
this.new_password_view = "icon i-password-view";
} else {
this.new_password_type = "password";
this.new_password_view = "icon i-password-not-view";
}
},
submitForm(form) {
this.$refs[form].validate((valid) => {
if (valid) {
this.$Axios({
method: "post",
url: this.auth_base_url + "users/" + this.user_unid + "/password",
headers: { authorization: this.rtoken },
data: {
old_pwd: this.password_form.odd_password,
new_pwd: this.password_form.new_password,
},
})
.then((response) => {
if (response.data.user_unid) {
this.$message({
type: "success",
message: "修改成功",
});
this.resetForm("password_form");
}
})
.catch((err) => {
this.$message.error("修改失败");
this.resetForm("password_form");
});
}
});
},
resetForm(form) {
this.$refs[form].resetFields();
},
},
created() {
if (!sessionStorage.getItem("user_unid")) {
this.$router.push("/");
} else {
this.rtoken = sessionStorage.getItem("rtoken");
this.user_unid = sessionStorage.getItem("user_unid");
}
if (localStorage.getItem("color")) {
this.color = localStorage.getItem("color");
}
},
};
</script>
<style scoped>
#user_wrapper {
width: 100%;
height: 100%;
}
#user >>> label {
color: black;
}
#user_wrapper >>> .el-card {
/* float: left; */
/* display: inline-block; */
background-color: rgba(0, 0, 0, 0);
}
#user >>> .el-card__body {
background-color: rgba(0, 0, 0, 0);
}
#user >>> input {
border-color: black;
color: black;
background-color: rgba(0, 0, 0, 0);
}
#user >>> .el-card__header {
background-color: #34352c;
}
#user >>> .el-input-group__prepend {
border-color: black;
color: black;
/* background-color: lightgray; */
background-color: rgba(0, 0, 0, 0);
}
#user >>> .el-input-group__append {
color: black;
border-color: black;
background-color: rgba(0, 0, 0, 0);
}
#user >>> .el-radio-button__inner {
border-color: black;
background-color: rgba(0, 0, 0, 0);
}
</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 ElementUI from 'element-ui'
import Axios from 'axios'
import Numeral from 'numeral'
// import PinYin from 'pinyin'
import CollapseTransition from 'element-ui/lib/transitions/collapse-transition';
import 'element-ui/lib/theme-chalk/index.css'
// import '../static/city-data'
// import "./mock"
import './assets/icons/iconfont.css'
import 'babel-polyfill'
// Vue.prototype.Pinyin = PinYin;
Vue.component(CollapseTransition.name, CollapseTransition)
Vue.config.productionTip = false
Vue.prototype.$Numeral = Numeral
Vue.prototype.$Axios = Axios
/* eslint-disable no-new */
Vue.use(ElementUI)
Vue.filter('twoDecimal', function (value) {
value = Number(value);
return value.toFixed(2);
});
let loading;
function startLoading() {
loading = Vue.prototype.$loading({
lock: true,
text: "加载中,请稍等",
background: "rgba(0, 0, 0, 1)"
})
}
function finishLoading() {
loading.close();
}
let requestCount = 0;
function showLoading() {
if (requestCount === 0) {
startLoading();
}
requestCount++;
};
function hideLoading() {
if (requestCount <= 0) return;
requestCount--;
if (requestCount === 0) {
finishLoading();
}
};
Axios.interceptors.request.use(
(config) => {
showLoading();
return config;
},
function (err) {
return Promise.reject(err);
}
);
Axios.interceptors.response.use((response) => {
setTimeout(() => {
hideLoading();
}, 300);
return response;
}, function (err) {
hideLoading()
return Promise.reject(err);
});
{
if (window.location.host == 'localhost:8888') {
Vue.prototype.$disparch_data = {
code_base_url: "http://192.168.9.110:20080/api/v1/codes/",
contract_base_url: "http://192.168.9.110:20080/api/v1/financial/contracts/",
auth_base_url: "http://192.168.9.110:20080/api/v1/auth/"
}
} else {
var url = window.location.host;
Vue.prototype.$disparch_data = {
code_base_url: "http://" + url + "/api/v1/codes/",
contract_base_url: "http://" + url + "/api/v1/financial/contracts/",
auth_base_url: "http://" + url + "/api/v1/auth/"
}
}
}
new Vue({
el: '#app',
router,
components: {
App
},
template: '<App/>'
})
const Mock = require('mockjs');
Mock.mock("/api/v1/financial/contracts/contract/project/acceptancs", 'post', res => {
console.log("project add successful");
console.log(res.body);
return {
encode: 200
}
})
import Vue from 'vue'
import Router from 'vue-router'
import Nav from '@/components/nav'
import Login from '@/components/login'
import Search from '@/components/search'
import Contract from '@/components/contract'
import Manage from '@/components/manage'
import Main from '@/components/main'
import User from '@/components/user'
Vue.use(Router)
export default new Router({
routes: [{
path: '/',
component: Login
},
{
path: '/nav',
component: Nav,
name: "nav",
children: [{
path: 'search',
component: Search,
name: 'search'
}, {
path: 'contract/:contract_unid',
component: Contract,
name:"contract"
}, {
path: 'manage',
component: Manage,
name:'manage'
}, {
path: 'main',
component: Main,
name:'main'
}, {
path: 'user',
component: User,
name:'user'
}
]
}
]
})
File mode changed
No preview for this file type
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!