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.
Files changed (36) hide show
  1. package/.browserslistrc +2 -0
  2. package/.eslintrc.js +18 -0
  3. package/.prettierrc +6 -0
  4. package/.vscode/settings.json +10 -0
  5. package/babel.config.js +10 -0
  6. package/package.json +12 -20
  7. package/postcss.config.js +5 -0
  8. package/script/npm_install.ps1 +3 -0
  9. package/script/npm_publish.ps1 +3 -0
  10. package/script/npm_update.ps1 +3 -0
  11. package/src/components/enum-checkbox/index.vue +1 -1
  12. package/src/components/enum-radio/index.vue +1 -1
  13. package/src/components/enum-select/index.vue +1 -1
  14. package/src/components/index.js +1 -1
  15. package/src/components/login-mode-select/index.vue +1 -1
  16. package/src/components/module-select/index.vue +1 -1
  17. package/src/components/platform-select/index.vue +1 -1
  18. package/src/components/role-select/index.vue +1 -1
  19. package/src/index.js +6 -6
  20. package/src/routes/index.js +1 -1
  21. package/src/views/account/components/save/index.vue +1 -1
  22. package/src/views/account/index/index.vue +1 -1
  23. package/src/views/auditInfo/components/details/index.vue +1 -1
  24. package/src/views/button/permission-bind/index.vue +1 -1
  25. package/src/views/cache/index/index.vue +1 -1
  26. package/src/views/file/index/index.vue +1 -1
  27. package/src/views/menu/components/add/index.vue +1 -1
  28. package/src/views/menu/components/edit/index.vue +1 -1
  29. package/src/views/mime/components/save/index.vue +1 -1
  30. package/src/views/mime/index/index.vue +1 -1
  31. package/src/views/module/components/page-list/index.vue +1 -1
  32. package/src/views/module/components/permission-list/index.vue +1 -1
  33. package/src/views/role/components/platform-bind/index.vue +1 -1
  34. package/src/views/role/components/save/index.vue +1 -1
  35. package/src/views/role/index/index.vue +1 -1
  36. package/vue.config.js +109 -0
@@ -0,0 +1,2 @@
1
+ > 1%
2
+ last 2 versions
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
@@ -0,0 +1,6 @@
1
+ {
2
+ "tabWidth": 2,
3
+ "semi": false,
4
+ "singleQuote": true,
5
+ "printWidth": 200
6
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "editor.defaultFormatter": "esbenp.prettier-vscode",
3
+ "editor.formatOnPaste": true,
4
+ "editor.formatOnSave": true,
5
+ "editor.formatOnType": true,
6
+ "editor.codeActionsOnSave": {
7
+ "source.fixAll.tslint": true,
8
+ "source.fixAll.eslint": true
9
+ }
10
+ }
@@ -0,0 +1,10 @@
1
+ module.exports = {
2
+ presets: [
3
+ [
4
+ '@vue/cli-plugin-babel/preset',
5
+ {
6
+ useBuiltIns: 'entry'
7
+ }
8
+ ]
9
+ ]
10
+ }
package/package.json CHANGED
@@ -1,19 +1,21 @@
1
1
  {
2
+ "id": 0,
2
3
  "name": "haiwei-module-admin",
3
- "version": "1.0.0",
4
- "description": "HaiWei前端Admin模块组件",
5
- "author": "Eric",
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": "powershell -Command \"if (Test-Path node_modules) { Remove-Item -Recurse -Force node_modules }; if (Test-Path dist) { Remove-Item -Recurse -Force dist }\"",
13
- "cc": "powershell -Command \"if (Test-Path node_modules/.cache) { Remove-Item -Recurse -Force node_modules/.cache }\"",
14
- "i": "cd ./script && npm_install.bat",
15
- "up": "cd ./script && npm_update.bat",
16
- "pub": "cd ./script && npm_publish.bat"
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.main.git"
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
  }
@@ -0,0 +1,5 @@
1
+ module.exports = {
2
+ plugins: {
3
+ autoprefixer: {}
4
+ }
5
+ }
@@ -0,0 +1,3 @@
1
+ cd ../
2
+ npm --registry https://registry.npmjs.org/ install
3
+ pause
@@ -0,0 +1,3 @@
1
+ cd ../
2
+ npm --registry https://registry.npmjs.org/ publish
3
+ pause
@@ -0,0 +1,3 @@
1
+ cd ../
2
+ npm --registry https://registry.npmjs.org/ update
3
+ pause
@@ -1,5 +1,5 @@
1
1
  <script>
2
- import { mixins } from 'netmodular-ui'
2
+ import { mixins } from 'haiwei-ui'
3
3
  export default {
4
4
  mixins: [mixins.checkbox],
5
5
  data() {
@@ -1,5 +1,5 @@
1
1
  <script>
2
- import { mixins } from 'netmodular-ui'
2
+ import { mixins } from 'haiwei-ui'
3
3
  export default {
4
4
  mixins: [mixins.radio],
5
5
  data() {
@@ -1,5 +1,5 @@
1
1
  <script>
2
- import { mixins } from 'netmodular-ui'
2
+ import { mixins } from 'haiwei-ui'
3
3
  export default {
4
4
  mixins: [mixins.select],
5
5
  data() {
@@ -1,4 +1,4 @@
1
- import library from 'netmodular-ui/packages/library'
1
+ import library from 'haiwei-ui/packages/library'
2
2
  let components = []
3
3
  const requireComponent = require.context('./', true, /index\.vue$/)
4
4
  requireComponent.keys().map(fileName => {
@@ -1,5 +1,5 @@
1
1
  <script>
2
- import { mixins } from 'netmodular-ui'
2
+ import { mixins } from 'haiwei-ui'
3
3
  export default {
4
4
  mixins: [mixins.select],
5
5
  data() {
@@ -1,5 +1,5 @@
1
1
  <script>
2
- import { mixins } from 'netmodular-ui'
2
+ import { mixins } from 'haiwei-ui'
3
3
  export default {
4
4
  mixins: [mixins.select],
5
5
  data() {
@@ -1,5 +1,5 @@
1
1
  <script>
2
- import { mixins } from 'netmodular-ui'
2
+ import { mixins } from 'haiwei-ui'
3
3
  export default {
4
4
  mixins: [mixins.select],
5
5
  data() {
@@ -1,5 +1,5 @@
1
1
  <script>
2
- import { mixins } from 'netmodular-ui'
2
+ import { mixins } from 'haiwei-ui'
3
3
  export default {
4
4
  mixins: [mixins.select],
5
5
  data() {
package/src/index.js CHANGED
@@ -1,10 +1,10 @@
1
- import NetModularUI from 'netmodular-ui'
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 NetmodularSkinsClassics from 'netmodular-skins-classics'
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) NetModularUI.registerSkin(skin)
32
+ if (skin) haiweiUI.registerSkin(skin)
33
33
  },
34
34
  /**
35
35
  * @description 启动
36
36
  */
37
37
  async start(config) {
38
38
  // 设置接口信息
39
- NetModularUI.configApi(config)
39
+ haiweiUI.configApi(config)
40
40
  // 使用皮肤
41
- NetModularUI.registerSkin(NetmodularSkinsClassics)
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
- NetModularUI.use({ config: UIConfig, modules, actions })
65
+ haiweiUI.use({ config: UIConfig, modules, actions })
66
66
  }
67
67
  }, 20)
68
68
  }
@@ -1,3 +1,3 @@
1
- import loadRoutes from 'netmodular-ui/packages/utils/load-routes'
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-form-dialog>
26
26
  </template>
27
27
  <script>
28
- import { mixins } from 'netmodular-ui'
28
+ import { mixins } from 'haiwei-ui'
29
29
 
30
30
  // 接口
31
31
  const { add, edit, update } = $api.admin.account
@@ -69,7 +69,7 @@
69
69
  </template>
70
70
  <script>
71
71
  import { mapState } from 'vuex'
72
- import { mixins } from 'netmodular-ui'
72
+ import { mixins } from 'haiwei-ui'
73
73
  import page from './page'
74
74
  import cols from './cols'
75
75
  import SavePage from '../components/save'
@@ -22,7 +22,7 @@
22
22
  </nm-drawer>
23
23
  </template>
24
24
  <script>
25
- import { mixins } from 'netmodular-ui'
25
+ import { mixins } from 'haiwei-ui'
26
26
 
27
27
  // 接口
28
28
  const api = $api.admin.auditInfo
@@ -4,7 +4,7 @@
4
4
  </nm-dialog>
5
5
  </template>
6
6
  <script>
7
- import { mixins } from 'netmodular-ui'
7
+ import { mixins } from 'haiwei-ui'
8
8
  import BindPage from '../../permission/components/bind'
9
9
 
10
10
  // 接口
@@ -16,7 +16,7 @@
16
16
  </nm-container>
17
17
  </template>
18
18
  <script>
19
- import { mixins } from 'netmodular-ui'
19
+ import { mixins } from 'haiwei-ui'
20
20
  import page from './page'
21
21
  import cols from './cols'
22
22
 
@@ -21,7 +21,7 @@
21
21
  </nm-container>
22
22
  </template>
23
23
  <script>
24
- import { mixins } from 'netmodular-ui'
24
+ import { mixins } from 'haiwei-ui'
25
25
  import page from './page'
26
26
  import cols from './cols'
27
27
 
@@ -21,7 +21,7 @@
21
21
  </nm-dialog>
22
22
  </template>
23
23
  <script>
24
- import { mixins } from 'netmodular-ui'
24
+ import { mixins } from 'haiwei-ui'
25
25
  import NodeMenu from './components/node'
26
26
  import RouteMenu from './components/route'
27
27
  import LinkMenu from './components/link'
@@ -10,7 +10,7 @@
10
10
  </nm-dialog>
11
11
  </template>
12
12
  <script>
13
- import { mixins } from 'netmodular-ui'
13
+ import { mixins } from 'haiwei-ui'
14
14
  import NodeMenu from './components/node'
15
15
  import RouteMenu from './components/route'
16
16
  import LinkMenu from './components/link'
@@ -13,7 +13,7 @@
13
13
  </nm-form-dialog>
14
14
  </template>
15
15
  <script>
16
- import { mixins } from 'netmodular-ui'
16
+ import { mixins } from 'haiwei-ui'
17
17
 
18
18
  // 接口
19
19
  const { add, edit, update } = $api.admin.mime
@@ -25,7 +25,7 @@
25
25
  </nm-container>
26
26
  </template>
27
27
  <script>
28
- import { mixins } from 'netmodular-ui'
28
+ import { mixins } from 'haiwei-ui'
29
29
  import page from './page'
30
30
  import cols from './cols'
31
31
  import SavePage from '../components/save'
@@ -102,7 +102,7 @@
102
102
  </template>
103
103
  <script>
104
104
  import { mapState } from 'vuex'
105
- import { mixins } from 'netmodular-ui'
105
+ import { mixins } from 'haiwei-ui'
106
106
 
107
107
  const { queryByCodes } = $api.admin.permission
108
108
 
@@ -14,7 +14,7 @@
14
14
  </nm-list-dialog>
15
15
  </template>
16
16
  <script>
17
- import { mixins } from 'netmodular-ui'
17
+ import { mixins } from 'haiwei-ui'
18
18
  import cols from './cols'
19
19
  const { query } = $api.admin.permission
20
20
 
@@ -25,7 +25,7 @@
25
25
  </nm-box>
26
26
  </template>
27
27
  <script>
28
- import { mixins } from 'netmodular-ui'
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 {
@@ -13,7 +13,7 @@
13
13
  </nm-form-dialog>
14
14
  </template>
15
15
  <script>
16
- import { mixins } from 'netmodular-ui'
16
+ import { mixins } from 'haiwei-ui'
17
17
 
18
18
  // 接口
19
19
  const { add, edit, update } = $api.admin.role
@@ -26,7 +26,7 @@
26
26
  </nm-container>
27
27
  </template>
28
28
  <script>
29
- import { mixins } from 'netmodular-ui'
29
+ import { mixins } from 'haiwei-ui'
30
30
  import page from './page'
31
31
  import RoleTree from '../components/tree'
32
32
  import MenuBind from '../components/menu-bind'
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
+ }