ytg7vue 1.16.1
Sign up to get free protection for your applications and to get access to all the features.
- package/.babelrc +17 -0
- package/.editorconfig +14 -0
- package/.eslintignore +3 -0
- package/.eslintrc.js +151 -0
- package/.npminstall.done +1 -0
- package/.postcssrc.js +8 -0
- package/LICENSE +21 -0
- package/Listening +28 -0
- package/README.md +146 -0
- package/build/build.js +70 -0
- package/build/check-versions.js +45 -0
- package/build/config.js +81 -0
- package/build/dev-client.js +9 -0
- package/build/dev-server.js +93 -0
- package/build/utils.js +78 -0
- package/build/vue-loader.conf.js +12 -0
- package/build/webpack.common.js +37 -0
- package/build/webpack.component.js +36 -0
- package/build/webpack.prod.conf.js +38 -0
- package/components.json +8 -0
- package/conf.js +42 -0
- package/config/dev.env.js +6 -0
- package/config/index.js +43 -0
- package/config/prod.env.js +6 -0
- package/config/sit.env.js +6 -0
- package/favicon.ico +0 -0
- package/index.html +17 -0
- package/jsdoc-vue.js +12 -0
- package/lib/idev.common.js +1 -0
- package/lib/index.js +46869 -0
- package/lib/js/HdBtn.js +1 -0
- package/lib/js/HdComGrid.js +1 -0
- package/lib/js/HdGrid.js +1 -0
- package/lib/js/HdHotkey.js +1 -0
- package/lib/js/HdTableColumn.js +1 -0
- package/lib/js/HdTreeTable.js +1 -0
- package/package.json +115 -0
@@ -0,0 +1,93 @@
|
|
1
|
+
require('./check-versions')(); // 检查 Node 和 npm 版本
|
2
|
+
|
3
|
+
var config = require('../config');
|
4
|
+
if (!process.env.NODE_ENV) {
|
5
|
+
process.env.NODE_ENV = JSON.parse(config.dev.env.NODE_ENV)
|
6
|
+
}
|
7
|
+
|
8
|
+
var opn = require('opn')
|
9
|
+
var path = require('path');
|
10
|
+
var express = require('express');
|
11
|
+
var webpack = require('webpack');
|
12
|
+
var proxyMiddleware = require('http-proxy-middleware');
|
13
|
+
var webpackConfig = require('./webpack.dev.conf');
|
14
|
+
|
15
|
+
// default port where dev server listens for incoming traffic
|
16
|
+
var port = process.env.PORT || config.dev.port;
|
17
|
+
// automatically open browser, if not set will be false
|
18
|
+
var autoOpenBrowser = !!config.dev.autoOpenBrowser;
|
19
|
+
// Define HTTP proxies to your custom API backend
|
20
|
+
// https://github.com/chimurai/http-proxy-middleware
|
21
|
+
var proxyTable = config.dev.proxyTable;
|
22
|
+
|
23
|
+
var app = express();
|
24
|
+
var compiler = webpack(webpackConfig);
|
25
|
+
|
26
|
+
var devMiddleware = require('webpack-dev-middleware')(compiler, {
|
27
|
+
publicPath: webpackConfig.output.publicPath,
|
28
|
+
quiet: true
|
29
|
+
});
|
30
|
+
|
31
|
+
var hotMiddleware = require('webpack-hot-middleware')(compiler, {
|
32
|
+
log: false,
|
33
|
+
heartbeat: 2000
|
34
|
+
});
|
35
|
+
|
36
|
+
// force page reload when html-webpack-plugin template changes
|
37
|
+
// currently disabled until this is resolved:
|
38
|
+
// https://github.com/jantimon/html-webpack-plugin/issues/680
|
39
|
+
// compiler.plugin('compilation', function (compilation) {
|
40
|
+
// compilation.plugin('html-webpack-plugin-after-emit', function (data, cb) {
|
41
|
+
// hotMiddleware.publish({ action: 'reload' })
|
42
|
+
// cb()
|
43
|
+
// })
|
44
|
+
// })
|
45
|
+
|
46
|
+
// proxy api requests
|
47
|
+
Object.keys(proxyTable).forEach(function (context) {
|
48
|
+
var options = proxyTable[context]
|
49
|
+
if (typeof options === 'string') {
|
50
|
+
options = {target: options}
|
51
|
+
}
|
52
|
+
app.use(proxyMiddleware(options.filter || context, options))
|
53
|
+
});
|
54
|
+
|
55
|
+
// handle fallback for HTML5 history API
|
56
|
+
app.use(require('connect-history-api-fallback')());
|
57
|
+
|
58
|
+
// serve webpack bundle output
|
59
|
+
app.use(devMiddleware);
|
60
|
+
|
61
|
+
// enable hot-reload and state-preserving
|
62
|
+
// compilation error display
|
63
|
+
app.use(hotMiddleware);
|
64
|
+
|
65
|
+
// serve pure static assets
|
66
|
+
var staticPath = path.posix.join(config.dev.assetsPublicPath, config.dev.assetsSubDirectory);
|
67
|
+
app.use(staticPath, express.static('./static'));
|
68
|
+
|
69
|
+
var uri = 'http://localhost:' + port
|
70
|
+
|
71
|
+
var _resolve
|
72
|
+
var readyPromise = new Promise(resolve => {
|
73
|
+
_resolve = resolve
|
74
|
+
})
|
75
|
+
|
76
|
+
console.log('> Starting dev server...')
|
77
|
+
devMiddleware.waitUntilValid(() => {
|
78
|
+
console.log('> Listening at ' + uri + '\n')
|
79
|
+
// when env is testing, don't need open it
|
80
|
+
if (autoOpenBrowser && process.env.NODE_ENV !== 'testing') {
|
81
|
+
opn(uri)
|
82
|
+
}
|
83
|
+
_resolve()
|
84
|
+
})
|
85
|
+
|
86
|
+
var server = app.listen(port)
|
87
|
+
|
88
|
+
module.exports = {
|
89
|
+
ready: readyPromise,
|
90
|
+
close: () => {
|
91
|
+
server.close()
|
92
|
+
}
|
93
|
+
}
|
package/build/utils.js
ADDED
@@ -0,0 +1,78 @@
|
|
1
|
+
var path = require('path')
|
2
|
+
var config = require('../config')
|
3
|
+
var ExtractTextPlugin = require('extract-text-webpack-plugin')
|
4
|
+
|
5
|
+
exports.assetsPath = function (_path) {
|
6
|
+
var assetsSubDirectory = process.env.NODE_ENV === 'production'
|
7
|
+
? config.build.assetsSubDirectory
|
8
|
+
: config.dev.assetsSubDirectory
|
9
|
+
return path.posix.join(assetsSubDirectory, _path)
|
10
|
+
}
|
11
|
+
|
12
|
+
exports.cssLoaders = function (options) {
|
13
|
+
options = options || {}
|
14
|
+
|
15
|
+
var cssLoader = {
|
16
|
+
loader: 'css-loader',
|
17
|
+
options: {
|
18
|
+
minimize: process.env.NODE_ENV === 'production',
|
19
|
+
sourceMap: options.sourceMap
|
20
|
+
}
|
21
|
+
}
|
22
|
+
|
23
|
+
var postcssLoader = {
|
24
|
+
loader: 'postcss-loader',
|
25
|
+
options: {
|
26
|
+
sourceMap: true
|
27
|
+
}
|
28
|
+
}
|
29
|
+
|
30
|
+
// generate loader string to be used with extract text plugin
|
31
|
+
function generateLoaders (loader, loaderOptions) {
|
32
|
+
var loaders = options.usePostCSS !== false ? [cssLoader, postcssLoader] : [cssLoader]
|
33
|
+
if (loader) {
|
34
|
+
loaders.push({
|
35
|
+
loader: loader + '-loader',
|
36
|
+
options: Object.assign({}, loaderOptions, {
|
37
|
+
sourceMap: options.sourceMap
|
38
|
+
})
|
39
|
+
})
|
40
|
+
}
|
41
|
+
|
42
|
+
// Extract CSS when that option is specified
|
43
|
+
// (which is the case during production build)
|
44
|
+
if (options.extract) {
|
45
|
+
return ExtractTextPlugin.extract({
|
46
|
+
use: loaders,
|
47
|
+
fallback: 'vue-style-loader'
|
48
|
+
})
|
49
|
+
} else {
|
50
|
+
return ['vue-style-loader'].concat(loaders)
|
51
|
+
}
|
52
|
+
}
|
53
|
+
|
54
|
+
// https://vue-loader.vuejs.org/en/configurations/extract-css.html
|
55
|
+
return {
|
56
|
+
css: generateLoaders(),
|
57
|
+
postcss: generateLoaders(),
|
58
|
+
less: generateLoaders('less'),
|
59
|
+
sass: generateLoaders('sass', { indentedSyntax: true }),
|
60
|
+
scss: generateLoaders('sass'),
|
61
|
+
stylus: generateLoaders('stylus'),
|
62
|
+
styl: generateLoaders('stylus')
|
63
|
+
}
|
64
|
+
}
|
65
|
+
|
66
|
+
// Generate loaders for standalone style files (outside of .vue)
|
67
|
+
exports.styleLoaders = function (options) {
|
68
|
+
var output = []
|
69
|
+
var loaders = exports.cssLoaders(options)
|
70
|
+
for (var extension in loaders) {
|
71
|
+
var loader = loaders[extension]
|
72
|
+
output.push({
|
73
|
+
test: new RegExp('\\.' + extension + '$'),
|
74
|
+
use: loader
|
75
|
+
})
|
76
|
+
}
|
77
|
+
return output
|
78
|
+
}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
var utils = require('./utils')
|
2
|
+
var config = require('../config')
|
3
|
+
var isProduction = process.env.NODE_ENV === 'production'
|
4
|
+
|
5
|
+
module.exports = {
|
6
|
+
loaders: utils.cssLoaders({
|
7
|
+
sourceMap: isProduction
|
8
|
+
? config.build.productionSourceMap
|
9
|
+
: config.dev.cssSourceMap,
|
10
|
+
extract: isProduction
|
11
|
+
})
|
12
|
+
}
|
@@ -0,0 +1,37 @@
|
|
1
|
+
var path = require('path');
|
2
|
+
var webpack = require('webpack');
|
3
|
+
|
4
|
+
const config = require('./config');
|
5
|
+
|
6
|
+
module.exports = {
|
7
|
+
entry: {
|
8
|
+
main: './src/idev.common.js'
|
9
|
+
},
|
10
|
+
output: {
|
11
|
+
path: path.resolve(__dirname, '../lib'),
|
12
|
+
publicPath: '/dist/',
|
13
|
+
filename: 'idev.common.js',
|
14
|
+
chunkFilename: '[id].js',
|
15
|
+
library: 'idevvue',
|
16
|
+
libraryExport: 'default',
|
17
|
+
libraryTarget: 'commonjs2'
|
18
|
+
},
|
19
|
+
externals: config.externals,
|
20
|
+
resolve: {
|
21
|
+
extensions: ['.js', '.vue'],
|
22
|
+
alias: config.alias
|
23
|
+
},
|
24
|
+
module: {
|
25
|
+
loaders: config.loaders
|
26
|
+
},
|
27
|
+
plugins: [
|
28
|
+
new webpack.DefinePlugin({
|
29
|
+
'process.env': {
|
30
|
+
NODE_ENV: '"production"'
|
31
|
+
}
|
32
|
+
})
|
33
|
+
]
|
34
|
+
}
|
35
|
+
module.exports.plugins.push(
|
36
|
+
new webpack.optimize.UglifyJsPlugin({sourceMap: true})
|
37
|
+
);
|
@@ -0,0 +1,36 @@
|
|
1
|
+
|
2
|
+
|
3
|
+
var path = require('path');
|
4
|
+
var webpack = require('webpack');
|
5
|
+
|
6
|
+
const config = require('./config');
|
7
|
+
const Components = require('../components.json');
|
8
|
+
|
9
|
+
module.exports = {
|
10
|
+
entry: Components,
|
11
|
+
output: {
|
12
|
+
path: path.resolve(__dirname, '../lib'),
|
13
|
+
publicPath: '/dist/',
|
14
|
+
filename: 'js/[name].js',
|
15
|
+
chunkFilename: '[id].js',
|
16
|
+
libraryTarget: 'commonjs2',
|
17
|
+
},
|
18
|
+
externals: config.externals,
|
19
|
+
resolve: {
|
20
|
+
extensions: ['.js', '.vue'],
|
21
|
+
alias: config.alias
|
22
|
+
},
|
23
|
+
module: {
|
24
|
+
loaders: config.loaders
|
25
|
+
},
|
26
|
+
plugins: [
|
27
|
+
new webpack.DefinePlugin({
|
28
|
+
'process.env': {
|
29
|
+
NODE_ENV: '"production"'
|
30
|
+
}
|
31
|
+
})
|
32
|
+
]
|
33
|
+
}
|
34
|
+
module.exports.plugins.push(
|
35
|
+
new webpack.optimize.UglifyJsPlugin({sourceMap: true}),
|
36
|
+
);
|
@@ -0,0 +1,38 @@
|
|
1
|
+
var path = require('path');
|
2
|
+
var webpack = require('webpack');
|
3
|
+
|
4
|
+
const config = require('./config');
|
5
|
+
|
6
|
+
module.exports = {
|
7
|
+
entry: {
|
8
|
+
main: './src/index.js'
|
9
|
+
},
|
10
|
+
output: {
|
11
|
+
path: path.resolve(__dirname, '../lib'),
|
12
|
+
publicPath: '/lib/',
|
13
|
+
filename: 'index.js',
|
14
|
+
library: 'lib',
|
15
|
+
libraryTarget: 'umd',
|
16
|
+
umdNamedDefine: true
|
17
|
+
},
|
18
|
+
externals: {
|
19
|
+
vue: config.vue
|
20
|
+
},
|
21
|
+
resolve: {
|
22
|
+
extensions: ['.js', '.vue'],
|
23
|
+
alias: config.alias
|
24
|
+
},
|
25
|
+
module: {
|
26
|
+
loaders: config.loaders
|
27
|
+
},
|
28
|
+
plugins: [
|
29
|
+
new webpack.DefinePlugin({
|
30
|
+
'process.env': {
|
31
|
+
NODE_ENV: '"production"'
|
32
|
+
}
|
33
|
+
})
|
34
|
+
]
|
35
|
+
}
|
36
|
+
module.exports.plugins.push(
|
37
|
+
new webpack.optimize.UglifyJsPlugin({sourceMap: true}),
|
38
|
+
);
|
package/components.json
ADDED
package/conf.js
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
/**
|
2
|
+
* jsdoc-vue 配置文件
|
3
|
+
*/
|
4
|
+
module.exports = {
|
5
|
+
"tags": {
|
6
|
+
"allowUnknownTags": true,
|
7
|
+
// 指定所用词典
|
8
|
+
"dictionaries": [
|
9
|
+
"jsdoc"
|
10
|
+
]
|
11
|
+
},
|
12
|
+
// 查找文件的深度 需要用 -r 参数
|
13
|
+
"recurseDepth": 10,
|
14
|
+
"source": {
|
15
|
+
"include": [
|
16
|
+
// 需要编译的文件路径 使用时请替换
|
17
|
+
"./src"
|
18
|
+
],
|
19
|
+
"includePattern": ".+\\.(vue)$",
|
20
|
+
"excludePattern": "(^|\\/|\\\\)_"
|
21
|
+
},
|
22
|
+
// 使用插件
|
23
|
+
"plugins": [
|
24
|
+
// 插件路径
|
25
|
+
"./jsdoc-vue"
|
26
|
+
],
|
27
|
+
"templates": {
|
28
|
+
"cleverLinks": false,
|
29
|
+
"monospaceLinks": true,
|
30
|
+
"useLongnameInNav": false,
|
31
|
+
"showInheritedInNav": true
|
32
|
+
},
|
33
|
+
"opts": {
|
34
|
+
// 文档输出路径
|
35
|
+
"destination": "./doc",
|
36
|
+
"encoding": "utf8",
|
37
|
+
"private": true,
|
38
|
+
"recurse": true,
|
39
|
+
// 使用模板 minami
|
40
|
+
"template": "./node_modules/minami"
|
41
|
+
}
|
42
|
+
}
|
package/config/index.js
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
// see http://vuejs-templates.github.io/webpack for documentation.
|
2
|
+
var path = require('path')
|
3
|
+
|
4
|
+
module.exports = {
|
5
|
+
build: {
|
6
|
+
sitEnv: require('./sit.env'),
|
7
|
+
prodEnv: require('./prod.env'),
|
8
|
+
index: path.resolve(__dirname, '../dist/index.html'),
|
9
|
+
assetsRoot: path.resolve(__dirname, '../dist'),
|
10
|
+
assetsSubDirectory: 'static',
|
11
|
+
assetsPublicPath: './', //请根据自己路径配置更改
|
12
|
+
productionSourceMap: false,
|
13
|
+
// Gzip off by default as many popular static hosts such as
|
14
|
+
// Surge or Netlify already gzip all static assets for you.
|
15
|
+
// Before setting to `true`, make sure to:
|
16
|
+
// npm install --save-dev compression-webpack-plugin
|
17
|
+
productionGzip: false,
|
18
|
+
productionGzipExtensions: ['js', 'css'],
|
19
|
+
// Run the build command with an extra argument to
|
20
|
+
// View the bundle analyzer report after build finishes:
|
21
|
+
// `npm run build --report`
|
22
|
+
// Set to `true` or `false` to always turn it on or off
|
23
|
+
bundleAnalyzerReport: process.env.npm_config_report
|
24
|
+
},
|
25
|
+
dev: {
|
26
|
+
env: require('./dev.env'),
|
27
|
+
port: 9527,
|
28
|
+
autoOpenBrowser: true,
|
29
|
+
assetsSubDirectory: 'static',
|
30
|
+
assetsPublicPath: '/',
|
31
|
+
proxyTable: {
|
32
|
+
'/webresources': 'http://localhost:8080',
|
33
|
+
'/PrivilegeVueController': 'http://localhost:8080'
|
34
|
+
|
35
|
+
},
|
36
|
+
// CSS Sourcemaps off by default because relative paths are "buggy"
|
37
|
+
// with this option, according to the CSS-Loader README
|
38
|
+
// (https://github.com/webpack/css-loader#sourcemaps)
|
39
|
+
// In our experience, they generally work as expected,
|
40
|
+
// just be aware of this issue when enabling this option.
|
41
|
+
cssSourceMap: false
|
42
|
+
}
|
43
|
+
}
|
package/favicon.ico
ADDED
Binary file
|
package/index.html
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
6
|
+
<meta name="renderer" content="webkit">
|
7
|
+
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
8
|
+
<title>GCTOS</title>
|
9
|
+
|
10
|
+
<script>if (typeof module === 'object') {window.jQuery = window.$ = module.exports;};</script>
|
11
|
+
</head>
|
12
|
+
<body>
|
13
|
+
<div id="app"></div>
|
14
|
+
<!-- built files will be auto injected -->
|
15
|
+
</body>
|
16
|
+
</html>
|
17
|
+
|
package/jsdoc-vue.js
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
var compiler = require('vue-template-compiler');
|
2
|
+
|
3
|
+
exports.handlers = {
|
4
|
+
// 利用 vue-template-compiler 编译 vue 模板
|
5
|
+
beforeParse: function (e) {
|
6
|
+
if (/\.vue$/.test(e.filename)) {
|
7
|
+
var output = compiler.parseComponent(e.source);
|
8
|
+
|
9
|
+
e.source = output.script ? output.script.content : '';
|
10
|
+
}
|
11
|
+
}
|
12
|
+
};
|