haiwei-module-admin 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.browserslistrc +2 -0
- package/.eslintrc.js +18 -0
- package/.prettierrc +6 -0
- package/.vscode/settings.json +10 -0
- package/babel.config.js +10 -0
- package/package.json +12 -20
- package/postcss.config.js +5 -0
- package/script/npm_install.ps1 +3 -0
- package/script/npm_publish.ps1 +3 -0
- package/script/npm_update.ps1 +3 -0
- package/src/components/enum-checkbox/index.vue +1 -1
- package/src/components/enum-radio/index.vue +1 -1
- package/src/components/enum-select/index.vue +1 -1
- package/src/components/index.js +1 -1
- package/src/components/login-mode-select/index.vue +1 -1
- package/src/components/module-select/index.vue +1 -1
- package/src/components/platform-select/index.vue +1 -1
- package/src/components/role-select/index.vue +1 -1
- package/src/index.js +6 -6
- package/src/routes/index.js +1 -1
- package/src/views/account/components/save/index.vue +1 -1
- package/src/views/account/index/index.vue +1 -1
- package/src/views/auditInfo/components/details/index.vue +1 -1
- package/src/views/button/permission-bind/index.vue +1 -1
- package/src/views/cache/index/index.vue +1 -1
- package/src/views/file/index/index.vue +1 -1
- package/src/views/menu/components/add/index.vue +1 -1
- package/src/views/menu/components/edit/index.vue +1 -1
- package/src/views/mime/components/save/index.vue +1 -1
- package/src/views/mime/index/index.vue +1 -1
- package/src/views/module/components/page-list/index.vue +1 -1
- package/src/views/module/components/permission-list/index.vue +1 -1
- package/src/views/role/components/platform-bind/index.vue +1 -1
- package/src/views/role/components/save/index.vue +1 -1
- package/src/views/role/index/index.vue +1 -1
- package/vue.config.js +109 -0
package/.browserslistrc
ADDED
package/.eslintrc.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
root: true,
|
|
3
|
+
env: {
|
|
4
|
+
node: true
|
|
5
|
+
},
|
|
6
|
+
extends: ['plugin:vue/essential', '@vue/prettier'],
|
|
7
|
+
rules: {
|
|
8
|
+
'no-console': 'off',
|
|
9
|
+
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
|
|
10
|
+
},
|
|
11
|
+
parserOptions: {
|
|
12
|
+
parser: 'babel-eslint'
|
|
13
|
+
},
|
|
14
|
+
globals: {
|
|
15
|
+
$http: 'readonly',
|
|
16
|
+
$api: 'readonly'
|
|
17
|
+
}
|
|
18
|
+
}
|
package/.prettierrc
ADDED
package/babel.config.js
ADDED
package/package.json
CHANGED
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
{
|
|
2
|
+
"id": 0,
|
|
2
3
|
"name": "haiwei-module-admin",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
4
|
+
"code": "admin",
|
|
5
|
+
"version": "1.0.1",
|
|
6
|
+
"description": "haiwei前端Admin模块组件",
|
|
7
|
+
"author": "Oldli",
|
|
6
8
|
"license": "ISC",
|
|
7
9
|
"main": "src/index.js",
|
|
8
10
|
"scripts": {
|
|
9
11
|
"serve": "vue-cli-service serve",
|
|
10
12
|
"build": "vue-cli-service build",
|
|
11
13
|
"lint": "vue-cli-service lint",
|
|
12
|
-
"cm": "
|
|
13
|
-
"cc": "
|
|
14
|
-
"i": "cd ./script && npm_install.
|
|
15
|
-
"up": "cd ./script && npm_update.
|
|
16
|
-
"pub": "cd ./script && npm_publish.
|
|
14
|
+
"cm": "rimraf node_modules",
|
|
15
|
+
"cc": "rimraf node_modules/.cache",
|
|
16
|
+
"i": "cd ./script && npm_install.ps1",
|
|
17
|
+
"up": "cd ./script && npm_update.ps1",
|
|
18
|
+
"pub": "cd ./script && npm_publish.ps1"
|
|
17
19
|
},
|
|
18
20
|
"dependencies": {
|
|
19
21
|
"haiwei-skins-classics": "^1.0.2",
|
|
@@ -39,16 +41,6 @@
|
|
|
39
41
|
},
|
|
40
42
|
"repository": {
|
|
41
43
|
"type": "git",
|
|
42
|
-
"url": "https://github.com/iamoldli/haiwei
|
|
43
|
-
}
|
|
44
|
-
"keywords": [
|
|
45
|
-
"haiwei",
|
|
46
|
-
"admin",
|
|
47
|
-
"module",
|
|
48
|
-
"vue",
|
|
49
|
-
"ui-framework"
|
|
50
|
-
],
|
|
51
|
-
"files": [
|
|
52
|
-
"src"
|
|
53
|
-
]
|
|
44
|
+
"url": "https://github.com/iamoldli/haiwei"
|
|
45
|
+
}
|
|
54
46
|
}
|
package/src/components/index.js
CHANGED
package/src/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import haiweiUI from 'haiwei-ui'
|
|
2
2
|
import './api'
|
|
3
3
|
import module from './module'
|
|
4
4
|
import routes from './routes'
|
|
5
5
|
import store from './store'
|
|
6
6
|
import components from './components'
|
|
7
|
-
import
|
|
7
|
+
import haiweiSkinsClassics from 'haiwei-skins-classics'
|
|
8
8
|
|
|
9
9
|
const admin = {
|
|
10
10
|
module,
|
|
@@ -29,16 +29,16 @@ export default {
|
|
|
29
29
|
* @param {object} skin 皮肤
|
|
30
30
|
*/
|
|
31
31
|
registerSkin(skin) {
|
|
32
|
-
if (skin)
|
|
32
|
+
if (skin) haiweiUI.registerSkin(skin)
|
|
33
33
|
},
|
|
34
34
|
/**
|
|
35
35
|
* @description 启动
|
|
36
36
|
*/
|
|
37
37
|
async start(config) {
|
|
38
38
|
// 设置接口信息
|
|
39
|
-
|
|
39
|
+
haiweiUI.configApi(config)
|
|
40
40
|
// 使用皮肤
|
|
41
|
-
|
|
41
|
+
haiweiUI.registerSkin(haiweiSkinsClassics)
|
|
42
42
|
|
|
43
43
|
// 获取UI配置信息
|
|
44
44
|
const UIConfig = await $api.admin.config.getUI()
|
|
@@ -62,7 +62,7 @@ export default {
|
|
|
62
62
|
const t = setInterval(() => {
|
|
63
63
|
if (window.loadProgress > 98) {
|
|
64
64
|
clearInterval(t)
|
|
65
|
-
|
|
65
|
+
haiweiUI.use({ config: UIConfig, modules, actions })
|
|
66
66
|
}
|
|
67
67
|
}, 20)
|
|
68
68
|
}
|
package/src/routes/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import loadRoutes from '
|
|
1
|
+
import loadRoutes from 'haiwei-ui/packages/utils/load-routes'
|
|
2
2
|
const requireComponent = require.context('../views', true, /\page.js$/)
|
|
3
3
|
export default loadRoutes(requireComponent.keys().map(fileName => requireComponent(fileName).route))
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
</nm-box>
|
|
26
26
|
</template>
|
|
27
27
|
<script>
|
|
28
|
-
import { mixins } from '
|
|
28
|
+
import { mixins } from 'haiwei-ui'
|
|
29
29
|
const api = $api.admin.permission
|
|
30
30
|
const { queryBindPlatformPermissions, bindPlatformPermissions } = $api.admin.role
|
|
31
31
|
export default {
|
package/vue.config.js
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
const path = require('path')
|
|
2
|
+
const CopyWebpackPlugin = require('copy-webpack-plugin')
|
|
3
|
+
const TerserPlugin = require('terser-webpack-plugin')
|
|
4
|
+
// 开发环境
|
|
5
|
+
const isDev = process.env.NODE_ENV === 'development'
|
|
6
|
+
// 打包输出路径
|
|
7
|
+
const outputDir = '../../WebHost/wwwroot/app'
|
|
8
|
+
|
|
9
|
+
// 环境变量
|
|
10
|
+
/**版权信息 */
|
|
11
|
+
process.env.VUE_APP_COPYRIGHT = '版权所有:尼古拉斯·老李 | 用代码改变世界'
|
|
12
|
+
/**版本号 */
|
|
13
|
+
process.env.VUE_APP_BUILD_TIME = require('dayjs')().format('YYYYMDHHmmss')
|
|
14
|
+
/**第三方依赖组件,写法示例:<script src="./lib/font.js"></script> */
|
|
15
|
+
process.env.VUE_APP_CUSTOM_SCRIPTS = ''
|
|
16
|
+
|
|
17
|
+
module.exports = {
|
|
18
|
+
outputDir: outputDir,
|
|
19
|
+
publicPath: '/app',
|
|
20
|
+
devServer: {
|
|
21
|
+
port: 5220
|
|
22
|
+
},
|
|
23
|
+
transpileDependencies: ['haiwei-*', 'element-ui'],
|
|
24
|
+
configureWebpack() {
|
|
25
|
+
let config = {
|
|
26
|
+
plugins: [
|
|
27
|
+
/**
|
|
28
|
+
* 复制haiwei-ui/public目录下的文件到输出目录
|
|
29
|
+
*/
|
|
30
|
+
new CopyWebpackPlugin([
|
|
31
|
+
{
|
|
32
|
+
from: path.join(__dirname, 'node_modules/haiwei-ui/public'),
|
|
33
|
+
to: path.join(__dirname, outputDir),
|
|
34
|
+
ignore: ['index.html']
|
|
35
|
+
}
|
|
36
|
+
])
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
if (!isDev) {
|
|
41
|
+
//自定义代码压缩
|
|
42
|
+
config.optimization = {
|
|
43
|
+
minimize: true,
|
|
44
|
+
minimizer: [
|
|
45
|
+
new TerserPlugin({
|
|
46
|
+
cache: true,
|
|
47
|
+
parallel: true,
|
|
48
|
+
sourceMap: false,
|
|
49
|
+
terserOptions: {
|
|
50
|
+
compress: {
|
|
51
|
+
drop_console: true,
|
|
52
|
+
drop_debugger: true
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
})
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return config
|
|
60
|
+
},
|
|
61
|
+
chainWebpack: config => {
|
|
62
|
+
/**
|
|
63
|
+
* 删除懒加载模块的 prefetch preload,降低带宽压力
|
|
64
|
+
* https://cli.vuejs.org/zh/guide/html-and-static-assets.html#prefetch
|
|
65
|
+
* https://cli.vuejs.org/zh/guide/html-and-static-assets.html#preload
|
|
66
|
+
* 而且预渲染时生成的 prefetch 标签是 modern 版本的,低版本浏览器是不需要的
|
|
67
|
+
*/
|
|
68
|
+
config.plugins.delete('prefetch').delete('preload')
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* 设置index.html模板路径,使用haiwei-ui/public中的模板
|
|
72
|
+
*/
|
|
73
|
+
config.plugin('html').tap(args => {
|
|
74
|
+
args[0].template = './node_modules/haiwei-ui/public/index.html'
|
|
75
|
+
return args
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
config
|
|
79
|
+
// 开发环境
|
|
80
|
+
.when(
|
|
81
|
+
isDev,
|
|
82
|
+
// sourcemap不包含列信息
|
|
83
|
+
config => config.devtool('cheap-source-map')
|
|
84
|
+
)
|
|
85
|
+
// 非开发环境
|
|
86
|
+
.when(!isDev, config => {
|
|
87
|
+
// 拆分
|
|
88
|
+
config.optimization.splitChunks({
|
|
89
|
+
chunks: 'all',
|
|
90
|
+
cacheGroups: {
|
|
91
|
+
elementUI: {
|
|
92
|
+
name: 'chunk-element-ui',
|
|
93
|
+
priority: 20,
|
|
94
|
+
test: /[\\/]node_modules[\\/]element-ui(.*)/
|
|
95
|
+
},
|
|
96
|
+
skins: {
|
|
97
|
+
name: 'chunk-haiwei-ui',
|
|
98
|
+
priority: 10,
|
|
99
|
+
test: /[\\/]node_modules[\\/]haiwei-ui(.*)/
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
})
|
|
103
|
+
|
|
104
|
+
config.optimization.runtimeChunk({
|
|
105
|
+
name: 'manifest'
|
|
106
|
+
})
|
|
107
|
+
})
|
|
108
|
+
}
|
|
109
|
+
}
|