Commit 612f7557 by 潘际乾

使用vue-cli构建项目

parent 2e057e0a
{
"presets": ["vue-app"],
"plugins": [
["transform-es2015-modules-commonjs", {
"allowTopLevelThis": true
}]
]
}
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
]
}
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -4,14 +4,15 @@ ...@@ -4,14 +4,15 @@
"author": "psbc", "author": "psbc",
"private": true, "private": true,
"scripts": { "scripts": {
"start": "webpack-dev-server --inline --hot --env.dev", "start": "vue-cli-service serve",
"build": "rimraf dist && webpack -p --progress --hide-modules" "build": "vue-cli-service build"
}, },
"dependencies": { "dependencies": {
"async-validator": "^3.5.2", "async-validator": "^3.5.2",
"axios": "^0.19.2", "axios": "^0.19.2",
"bignumber.js": "^9.0.1", "bignumber.js": "^9.0.1",
"cluster": "^0.7.7", "cluster": "^0.7.7",
"core-js": "^3.6.4",
"echarts": "^5.2.2", "echarts": "^5.2.2",
"element-ui": "^2.13.2", "element-ui": "^2.13.2",
"es6-promise": "^4.2.8", "es6-promise": "^4.2.8",
...@@ -26,24 +27,18 @@ ...@@ -26,24 +27,18 @@
"vue-draggable-resizable": "^2.2.0" "vue-draggable-resizable": "^2.2.0"
}, },
"engines": { "engines": {
"node": ">=6" "node": ">=8.9",
"npm": ">= 3.0.0"
}, },
"devDependencies": { "devDependencies": {
"autoprefixer": "^6.6.0", "@vue/cli-plugin-babel": "4.4.4",
"babel-core": "^6.24.1", "@vue/cli-service": "4.4.4",
"babel-loader": "^6.4.0", "autoprefixer": "9.5.1",
"babel-plugin-transform-es2015-modules-commonjs": "^6.26.2", "babel-plugin-dynamic-import-node": "2.3.3",
"babel-preset-vue-app": "^1.2.0", "html-webpack-plugin": "3.2.0",
"css-loader": "^0.27.0", "sass": "1.26.2",
"file-loader": "^0.10.1", "sass-loader": "8.0.2",
"html-webpack-plugin": "^2.24.1", "script-ext-html-webpack-plugin": "2.1.3",
"postcss-loader": "^1.3.3", "vue-template-compiler": "^2.6.11"
"rimraf": "^2.5.4",
"style-loader": "^0.13.2",
"url-loader": "^0.5.8",
"vue-loader": "^13.3.0",
"vue-template-compiler": "^2.6.11",
"webpack": "^2.4.1",
"webpack-dev-server": "^2.4.2"
} }
} }
module.exports = { module.exports = {
plugins: [ plugins: {
require('autoprefixer')() autoprefixer: {}
] }
} }
...@@ -3,6 +3,10 @@ ...@@ -3,6 +3,10 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="renderer" content="webkit">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title>新押汇系统</title> <title>新押汇系统</title>
<style> <style>
html,body,#app{ html,body,#app{
......
...@@ -45,7 +45,7 @@ export default { ...@@ -45,7 +45,7 @@ export default {
"didgrp.apl.pts.dihdig": [checkDidgrpAplPtsDihdigN100,], "didgrp.apl.pts.dihdig": [checkDidgrpAplPtsDihdigN100,],
//"didgrp.rec.conno": [checkDidgrpRecConnoN100, checkDidgrpRecConnoN1001,], //"didgrp.rec.conno": [checkDidgrpRecConnoN100, checkDidgrpRecConnoN1001,],
"didgrp.rec.conno": [checkDidgrpRecConnoN100,], "didgrp.rec.conno": [checkDidgrpRecConnoN100,],
"didgrp.blk.defdet": [checkDidgrpBlkDefdetN100, checkDidgrpBlkDefdetN100, checkDidgrpBlkDefdetN1001,], "didgrp.blk.defdet": [checkDidgrpBlkDefdetN100, checkDidgrpBlkDefdetN1001,],
"didgrp.rec.elcflg": [checkDidgrpRecElcflgN100,], "didgrp.rec.elcflg": [checkDidgrpRecElcflgN100,],
"didgrp.blk.insbnk": [checkDidgrpBlkInsbnkN100,], "didgrp.blk.insbnk": [checkDidgrpBlkInsbnkN100,],
"liaall.liaccv.totcovamt": [checkLiaallLiaccvTotcovamtN100,], "liaall.liaccv.totcovamt": [checkLiaallLiaccvTotcovamtN100,],
...@@ -95,11 +95,11 @@ export default { ...@@ -95,11 +95,11 @@ export default {
//"didgrp.rec.tenmaxday": [checkDidgrpRecTenmaxdayN1000, checkDidgrpRecTenmaxdayN1050,], //"didgrp.rec.tenmaxday": [checkDidgrpRecTenmaxdayN1000, checkDidgrpRecTenmaxdayN1050,],
"didgrp.rec.tenmaxday": [checkDidgrpRecTenmaxdayN1000,], "didgrp.rec.tenmaxday": [checkDidgrpRecTenmaxdayN1000,],
"didgrp.cbs.nom1.amt": [checkDidgrpCbsNom1AmtN100,], "didgrp.cbs.nom1.amt": [checkDidgrpCbsNom1AmtN100,],
"didgrp.blk.preper": [checkDidgrpBlkPreperN100, checkDidgrpBlkPreperN100,], "didgrp.blk.preper": [checkDidgrpBlkPreperN100,],
"didgrp.apl.adrelc": [checkDidgrpAplAdrelcN100,], "didgrp.apl.adrelc": [checkDidgrpAplAdrelcN100,],
"ditp.rmbp.ptsget.sdamod.dadsnd": [checkDitpRmbpPtsgetSdamodDadsndN100,], "ditp.rmbp.ptsget.sdamod.dadsnd": [checkDitpRmbpPtsgetSdamodDadsndN100,],
"didgrp.ben.pts.extact": [checkDidgrpBenPtsExtactN1001,], "didgrp.ben.pts.extact": [checkDidgrpBenPtsExtactN1001,],
"didgrp.blk.adlcnd": [checkDidgrpBlkAdlcndN100, checkDidgrpBlkAdlcndN100,], "didgrp.blk.adlcnd": [checkDidgrpBlkAdlcndN100,],
"litameadv": [checkLitameadvN100,ruleLitameadvN100,], "litameadv": [checkLitameadvN100,ruleLitameadvN100,],
"liaall.liaccv.relcshpct": [checkLiaallLiaccvRelcshpctN100,], "liaall.liaccv.relcshpct": [checkLiaallLiaccvRelcshpctN100,],
"didgrp.rec.bdflg":[resetDidgrpRecBdflg,], "didgrp.rec.bdflg":[resetDidgrpRecBdflg,],
...@@ -479,9 +479,9 @@ function checkDidgrpBlkDefdetN100(rule, value, callback) { ...@@ -479,9 +479,9 @@ function checkDidgrpBlkDefdetN100(rule, value, callback) {
* source:ditp.@0047.script * source:ditp.@0047.script
* ditp * ditp
*/ */
function checkDidgrpBlkDefdetN100(rule, value, callback) { // function checkDidgrpBlkDefdetN100(rule, value, callback) {
callback() // callback()
} // }
/** /**
* source:ditp.@0104.script * source:ditp.@0104.script
* ditp * ditp
...@@ -988,9 +988,9 @@ function checkDidgrpBlkPreperN100(rule, value, callback) { ...@@ -988,9 +988,9 @@ function checkDidgrpBlkPreperN100(rule, value, callback) {
* source:ditp.@0083.script * source:ditp.@0083.script
* ditp * ditp
*/ */
function checkDidgrpBlkPreperN100(rule, value, callback) { // function checkDidgrpBlkPreperN100(rule, value, callback) {
callback() // callback()
} // }
/** /**
* source:ptsp.@0039.script * source:ptsp.@0039.script
* ditp.aplp * ditp.aplp
...@@ -1026,9 +1026,9 @@ function checkDidgrpBlkAdlcndN100(rule, value, callback) { ...@@ -1026,9 +1026,9 @@ function checkDidgrpBlkAdlcndN100(rule, value, callback) {
* source:ditp.@0102.script * source:ditp.@0102.script
* ditp * ditp
*/ */
function checkDidgrpBlkAdlcndN100(rule, value, callback) { // function checkDidgrpBlkAdlcndN100(rule, value, callback) {
callback() // callback()
} // }
/** /**
* source:ditopn.@0090.script * source:ditopn.@0090.script
* *
......
import Vue from 'vue'
import ElementUI from 'element-ui'
\ No newline at end of file
...@@ -186,9 +186,9 @@ ...@@ -186,9 +186,9 @@
<script> <script>
import axios from 'axios' import axios from 'axios'
import bill_of_ladingPdf from "~/assets/demo-files/bill_of_lading.pdf"; // import bill_of_ladingPdf from "~/assets/demo-files/bill_of_lading.pdf";
import commercial_invoicePdf from "~/assets/demo-files/commercial_invoice.pdf"; // import commercial_invoicePdf from "~/assets/demo-files/commercial_invoice.pdf";
import marine_cargo_certificatePdf from "~/assets/demo-files/marine_cargo_certificate.pdf"; // import marine_cargo_certificatePdf from "~/assets/demo-files/marine_cargo_certificate.pdf";
export default { export default {
name: "OcrRecognition", name: "OcrRecognition",
......
...@@ -109,7 +109,7 @@ ...@@ -109,7 +109,7 @@
<script> <script>
import Api from "~/service/Api" import Api from "~/service/Api"
import commonProcess from "~/mixin/commonProcess" import commonProcess from "~/mixin/commonProcess"
import Pattern from "~/Model/Office/Pattern" import Pattern from "~/model/Office/Pattern"
import Default from "~/model/Office/Default"; import Default from "~/model/Office/Default";
import Check from "~/model/Office/Check"; import Check from "~/model/Office/Check";
import CodeTable from "~/config/CodeTable" import CodeTable from "~/config/CodeTable"
......
...@@ -14,9 +14,9 @@ ...@@ -14,9 +14,9 @@
<script> <script>
import Api from "~/service/Api" import Api from "~/service/Api"
import CodeTable from "~/config/CodeTable" import CodeTable from "~/config/CodeTable"
import Sptsel from "~/Model/Sptsel" import Sptsel from "~/model/Sptsel"
import commonProcess from "~/mixin/commonProcess.js" import commonProcess from "~/mixin/commonProcess.js"
import Pattern from "~/Model/Sptsel/Pattern" import Pattern from "~/model/Sptsel/Pattern"
import Utils from "~/utils/index" import Utils from "~/utils/index"
import Default from "~/model/Sptsel/Default"; import Default from "~/model/Sptsel/Default";
import Check from "~/model/Sptsel/Check"; import Check from "~/model/Sptsel/Check";
......
...@@ -377,7 +377,7 @@ ...@@ -377,7 +377,7 @@
</c-page> </c-page>
</template> </template>
<script> <script>
import Sptsel from "~/Model/Sptsel"; import Sptsel from "~/model/Sptsel";
import Api from "~/service/Api"; import Api from "~/service/Api";
import commonProcess from "~/mixin/commonProcess"; import commonProcess from "~/mixin/commonProcess";
import CodeTable from "~/config/CodeTable"; import CodeTable from "~/config/CodeTable";
......
...@@ -14,9 +14,9 @@ ...@@ -14,9 +14,9 @@
<script> <script>
import Api from "~/service/Api" import Api from "~/service/Api"
import CodeTable from "~/config/CodeTable" import CodeTable from "~/config/CodeTable"
import Sptsel from "~/Model/Sptsel" import Sptsel from "~/model/Sptsel"
import commonProcess from "~/mixin/commonProcess.js" import commonProcess from "~/mixin/commonProcess.js"
import Pattern from "~/Model/Sptsel/Pattern" import Pattern from "~/model/Sptsel/Pattern"
import Utils from "~/utils/index" import Utils from "~/utils/index"
import Default from "~/model/Sptsel/Default"; import Default from "~/model/Sptsel/Default";
import Check from "~/model/Sptsel/Check"; import Check from "~/model/Sptsel/Check";
......
...@@ -374,7 +374,7 @@ ...@@ -374,7 +374,7 @@
</template> </template>
<script> <script>
import Trnrel from "~/Model/Trnrel"; import Trnrel from "~/model/Trnrel";
import Api from "~/service/Api" import Api from "~/service/Api"
import commonProcess from "~/mixin/commonProcess"; import commonProcess from "~/mixin/commonProcess";
import CodeTable from "~/config/CodeTable" import CodeTable from "~/config/CodeTable"
......
...@@ -374,7 +374,7 @@ ...@@ -374,7 +374,7 @@
</template> </template>
<script> <script>
import Trnrel from "~/Model/Trnrel"; import Trnrel from "~/model/Trnrel";
import Api from "~/service/Api" import Api from "~/service/Api"
import commonProcess from "~/mixin/commonProcess"; import commonProcess from "~/mixin/commonProcess";
import CodeTable from "~/config/CodeTable" import CodeTable from "~/config/CodeTable"
......
...@@ -22,9 +22,9 @@ ...@@ -22,9 +22,9 @@
<script> <script>
import Api from "~/service/Api"; import Api from "~/service/Api";
import CodeTable from "~/config/CodeTable"; import CodeTable from "~/config/CodeTable";
import Trnrel from "~/Model/Trnrel"; import Trnrel from "~/model/Trnrel";
import commonProcess from "~/mixin/commonProcess"; import commonProcess from "~/mixin/commonProcess";
import Pattern from "~/Model/Trnrel/Pattern"; import Pattern from "~/model/Trnrel/Pattern";
import Default from "~/model/Trnrel/Default"; import Default from "~/model/Trnrel/Default";
import Check from "~/model/Trnrel/Check"; import Check from "~/model/Trnrel/Check";
import Inftrnps from "./Inftrnps"; import Inftrnps from "./Inftrnps";
......
...@@ -22,9 +22,9 @@ ...@@ -22,9 +22,9 @@
<script> <script>
import Api from "~/service/Api"; import Api from "~/service/Api";
import CodeTable from "~/config/CodeTable"; import CodeTable from "~/config/CodeTable";
import Trnrel from "~/Model/Trnrel"; import Trnrel from "~/model/Trnrel";
import commonProcess from "~/mixin/commonProcess"; import commonProcess from "~/mixin/commonProcess";
import Pattern from "~/Model/Trnrel/Pattern"; import Pattern from "~/model/Trnrel/Pattern";
import Default from "~/model/Trnrel/Default"; import Default from "~/model/Trnrel/Default";
import Check from "~/model/Trnrel/Check"; import Check from "~/model/Trnrel/Check";
import Inftrnps from "./Inftrnps"; import Inftrnps from "./Inftrnps";
......
'use strict'
const path = require('path')
function resolve(dir) {
return path.join(__dirname, dir)
}
// If your port is set to 80,
// use administrator privileges to execute the command line.
// For example, Mac: sudo npm run
// You can change the port by the following method:
// port = 9527 npm run dev OR npm run dev --port = 9527
const port = process.env.port || process.env.npm_config_port || 8010 // dev port
// All configuration item explanations can be find in https://cli.vuejs.org/config/
module.exports = {
/**
* You will need to set publicPath if you plan to deploy your site under a sub path,
* for example GitHub Pages. If you plan to deploy your site to https://foo.github.io/bar/,
* then publicPath should be set to "/bar/".
* In most cases please use '/' !!!
* Detail: https://cli.vuejs.org/config/#publicpath
*/
publicPath: '/',
outputDir: 'dist',
assetsDir: 'static',
productionSourceMap: false,
devServer: {
port: port,
open: true,
overlay: {
warnings: false,
errors: true
},
proxy: {
'/gjjs/': {
target: 'http://127.0.0.1:8081',
changeOrigin: true,
pathRewrite: {
'^/gjjs': '/gjjs'
}
},
/**
* ocr智能识别服务
*/
'/ocr/': {
target: 'http://192.168.0.110:5010',
// target: 'http://127.0.0.1:5000',
changeOrigin: true,
pathRewrite: {
'^/ocr': '/'
}
}
}
},
configureWebpack: {
// provide the app's title in webpack's name field, so that
// it can be accessed in index.html to inject the correct title.
devtool: 'source-map',
resolve: {
alias: {
'~': resolve('src')
}
},
output: {
// 方便浏览器看源码
devtoolModuleFilenameTemplate: (info) => {
const resPath = info.resourcePath;
if ((/\.vue$/.test(resPath) && info.allLoaders !== '') || /node_modules/.test(resPath)) {
return `webpack:///${resPath}?${info.hash}`;
}
return `webpack:///${resPath.replace('./src', 'SourceCode')}`;
}
}
},
chainWebpack(config) {
// it can improve the speed of the first screen, it is recommended to turn on preload
config.plugin('preload').tap(() => [
{
rel: 'preload',
// to ignore runtime.js
// https://github.com/vuejs/vue-cli/blob/dev/packages/@vue/cli-service/lib/config/app.js#L171
fileBlacklist: [/\.map$/, /hot-update\.js$/, /runtime\..*\.js$/],
include: 'initial'
}
])
// when there are many pages, it will cause too many meaningless requests
config.plugins.delete('prefetch')
config
.when(process.env.NODE_ENV !== 'development',
config => {
config
.plugin('ScriptExtHtmlWebpackPlugin')
.after('html')
.use('script-ext-html-webpack-plugin', [{
// `runtime` must same as runtimeChunk name. default is `runtime`
inline: /runtime\..*\.js$/
}])
.end()
config
.optimization.splitChunks({
chunks: 'all',
cacheGroups: {
libs: {
name: 'chunk-libs',
test: /[\\/]node_modules[\\/]/,
priority: 10,
chunks: 'initial' // only package third parties that are initially dependent
},
elementUI: {
name: 'chunk-elementUI', // split elementUI into a single package
priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app
test: /[\\/]node_modules[\\/]_?element-ui(.*)/ // in order to adapt to cnpm
},
commons: {
name: 'chunk-commons',
test: resolve('src/components'), // can customize your rules
minChunks: 3, // minimum common number
priority: 5,
reuseExistingChunk: true
}
}
})
// https:// webpack.js.org/configuration/optimization/#optimizationruntimechunk
config.optimization.runtimeChunk('single')
}
)
}
}
const resolve = require('path').resolve
const webpack = require('webpack')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const url = require('url')
const publicPath = ''
module.exports = (options = {}) => ({
entry: {
vendor: './src/vendor',
index: './src/main.js'
},
output: {
path: resolve(__dirname, 'dist'),
filename: options.dev ? '[name].js' : '[name].js?[chunkhash]',
chunkFilename: '[id].js?[chunkhash]',
publicPath: options.dev ? '/assets/' : publicPath
},
module: {
rules: [{
test: /\.vue$/,
use: ['vue-loader']
},
{
test: /\.js$/,
use: ['babel-loader'],
exclude: /node_modules/
},
{
test: /\.css$/,
use: ['style-loader', 'css-loader', 'postcss-loader']
},
{
test: /\.(png|jpg|jpeg|gif|eot|ttf|woff|woff2|svg|svgz)(\?.+)?$/,
use: [{
loader: 'url-loader',
options: {
limit: 10000
}
}]
},
{
test: /\.pdf$/,
loader: 'file-loader?mimetype=application/pdf&name=[name].pdf'
}
]
},
plugins: [
new webpack.optimize.CommonsChunkPlugin({
names: ['vendor', 'manifest']
}),
new HtmlWebpackPlugin({
template: 'src/index.html'
})
],
resolve: {
alias: {
'~': resolve(__dirname, 'src')
},
extensions: ['.js', '.vue', '.json', '.css']
},
devServer: {
host: '127.0.0.1',
port: 8010,
proxy: {
'/gjjs/': {
target: 'http://127.0.0.1:8081',
changeOrigin: true,
pathRewrite: {
'^/gjjs': '/gjjs'
}
},
/**
* ocr智能识别服务
*/
'/ocr/': {
target: 'http://192.168.0.110:5010',
// target: 'http://127.0.0.1:5000',
changeOrigin: true,
pathRewrite: {
'^/ocr': '/'
}
}
},
historyApiFallback: {
index: url.parse(options.dev ? '/assets/' : publicPath).pathname
}
},
devtool: '#source-map'
})
This source diff could not be displayed because it is too large. You can view the blob instead.
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