├── .browserslistrc
├── .env.development
├── .env.production
├── .gitignore
├── LICENSE
├── README.md
├── babel.config.js
├── other
├── admin1.jpg
├── admin2.jpg
└── skm.jpg
├── package-lock.json
├── package.json
├── postcss.config.js
├── public
├── favicon.ico
└── index.html
├── src
├── App.vue
├── api
│ ├── request.js
│ └── user.js
├── assets
│ ├── login
│ │ ├── login-bg-1.jpg
│ │ ├── login-bg-2.jpg
│ │ ├── qq.svg
│ │ ├── weibo.svg
│ │ └── weixin.svg
│ └── main
│ │ ├── avatar.jpg
│ │ ├── logo-dark.png
│ │ ├── logo-light.png
│ │ ├── logo-small.png
│ │ ├── nav-theme-dark.svg
│ │ └── nav-theme-light.svg
├── components
│ ├── footer
│ │ └── footer.vue
│ ├── main
│ │ ├── main.less
│ │ └── main.vue
│ └── message
│ │ └── message.vue
├── config
│ └── config.js
├── css
│ └── public.less
├── main.js
├── mock
│ ├── index.js
│ └── mock.js
├── router
│ ├── index.js
│ └── permission.js
├── store
│ ├── getters.js
│ ├── index.js
│ └── modules
│ │ ├── permission.js
│ │ ├── tagsView.js
│ │ └── user.js
├── utils
│ ├── permission.js
│ └── util.js
└── views
│ ├── Dashboard
│ ├── workplace.vue
│ └── workplace1.vue
│ ├── brief
│ └── brief.vue
│ ├── form
│ ├── advanced_form.vue
│ └── basic_form.vue
│ ├── login
│ └── login.vue
│ ├── permission
│ └── index.vue
│ └── tmp.vue
└── vue.config.js
/.browserslistrc:
--------------------------------------------------------------------------------
1 | > 1%
2 | ie 11
3 | last 2 versions
4 |
--------------------------------------------------------------------------------
/.env.development:
--------------------------------------------------------------------------------
1 | # just a flag
2 | ENV = 'development'
3 |
4 | # base api
5 | VUE_APP_BASE_API = '/dev-api'
6 |
--------------------------------------------------------------------------------
/.env.production:
--------------------------------------------------------------------------------
1 | # just a flag
2 | ENV = 'production'
3 |
4 | # base api
5 | VUE_APP_BASE_API = 'https://www.fastmock.site/mock/8b8187de5502cc6a522b78638621c2c4/HuiAdmin/'
6 |
7 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules
3 | /dist
4 |
5 | # local env files
6 | .env.local
7 | .env.*.local
8 |
9 | # Log files
10 | npm-debug.log*
11 | yarn-debug.log*
12 | yarn-error.log*
13 |
14 | # Editor directories and files
15 | .idea
16 | .vscode
17 | *.suo
18 | *.ntvs*
19 | *.njsproj
20 | *.sln
21 | *.sw?
22 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright [yyyy] [name of copyright owner]
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Hui-Admin-Template
2 | ## 基础框架简洁版
3 |
4 | 1. 简述:当前是[码云 Hui-Admin-Pro](https://gitee.com/zengxiaohui2019/Hui-Admin-Pro) /
5 | [GitHub Hui-Admin-Pro](https://gitgub.com/zengxiaohui2019/Hui-Admin-Pro) 的母版,也就是基础Template版,只有基础组件和框架
6 | - Hui-Admin-Pro是基于[基础版 Hui-Admin-Template](https://github.com/zengxiaohui2019/Hui-Admin-Template) 增加更多复杂功能
7 | - [Hui-Admin-Pro 在线演示](https://github.zengxiaohui.com/Hui-Admin-Pro)
8 | - [Hui-Admin-Template 在线演示](https://github.zengxiaohui.com/Hui-Admin-Template)
9 | - 说明:本人是写这个框架是抱着学习态度,无意冲突商业大佬利益。
10 | - 兼容说明:初测兼容ie11 360极速模式 谷歌 火狐 其他未测;界面适配笔记本和日常PC;不适配平板和手机。
11 | 2. 主要技术:
12 |
13 | iview4.0 + vuecli3.0
14 | vue-router路由跳转 (层级嵌套适配、跳转前的拦截、跳转后页面自动滚到顶部)
15 | vuex管理 (导航高亮、多分页标签切换、根据用户动态菜单路由控制等)
16 | less flex弹性布局
17 |
18 | 3. 更新日志:
19 |
20 | 1.1.0 2019-10-03 01:10
21 | - 历时两天多1小时,每一行代码纯手打。
22 | - 第1天:VueCli3.0基本环境搭建,插件安装,观摩iview-admin-pro布局搭配,做了基本框架页面布局
23 | - 第2天:新增导航 多栏目切换 通知下拉功能 路由鉴权
24 | 1.1.1 2019-10-03
25 | - 新增主题风格切换、多页签、顶栏通顶功能,增加配置文件
26 | 1.1.2 2019-10-04 am
27 | - 新增刷新页面功能
28 | 2.1.0 2020-05-16
29 | - 更换登录接口为在线mock
30 | - 重构了动态路由权限校验,实现根据登录接口返回的权限集合,动态渲染菜单和加载路由
31 | - 新增 按钮组件级别权限控制
32 |
33 | ## 启动
34 |
35 | npm install 安装依赖包
36 | npm run dev 开发模式运行
37 | npm run build 打包
38 |
39 | ### 已安装插件
40 | 1. axios 0.19.0 // 接口请求控件
41 | 2. iview 3.5.1
42 | 3. mockjs 1.0.1-beta3 // 数据模拟控件 不用可删除
43 | 4. moment 2.24.0 // 时间处理控件 不用可删除
44 | 5. vue-router 3.0.3
45 | 6. vuex 3.0.1
46 | 7. less 3.0.4
47 | 8. babel-polyfill 6.26.0 // ie兼容必须
48 |
49 | ### 目录说明
50 |
51 | Hui-Admin-Template
52 | node_modules npm install 后安装的依赖包
53 | other md文档需要的图片
54 | public 公共目录
55 | src 核心业务目录
56 | api 接口请求封装
57 | request.js axios配置和请求返回拦截
58 | user.js 登录接口封装
59 | assets 图片
60 | main 主框架用到的图片
61 | components 组件
62 | main 主框架
63 | message 消息通知
64 | config 基础配置
65 | config.js 基础配置文件
66 | utils 工具
67 | permission.js 按扭级权限校验
68 | util.js 常用业务文件(判断是否为空 等)
69 | css css
70 | public.less 全局公共css
71 | router 路由配置
72 | permission.js 路由权限校验
73 | router.js 路由操作处理文件
74 | views 页面
75 | tmp.vue 模板页面 (已包含常用的vue生命周期 可删除)
76 | store vuex目录
77 | App.vue 主入口vue
78 | main.js 主入口js
79 | .env.development 开发环境 上下文配置 VUE_APP_BASE_API = '/dev-api'
80 | .env.production 生产环境 上下文配置 VUE_APP_BASE_API = ''
81 | babel.config.js babel配置文件
82 | package.json npm包管理文件
83 | README.md 说明文档
84 | vue.config.js 开发打包配置文件
85 |
86 | ### 配置说明
87 |
88 | 1. 基本配置 config->config.js 里面有详细的说明
89 |
90 | // 默认系统名称
91 | export const siteTitle = 'Hui-Admin-Pro 企业级中台前端解决方案'
92 | // 默认首页
93 | export const indexPage = 'workplace'
94 |
95 | // 主题风格
96 | export const themeData = {
97 | themeType: 'dark', // 主题风格配置 dark(经典酷黑) 或者 light(极简雅白) 默认dark经典酷黑
98 | isTabsShow: true, // 是否显示多页签 默认true
99 | headMaxWidth: false // 栏目头部是否通顶(最大宽度) 默认false
100 | }
101 |
102 | 2. 用户数据 在store/modules/user.js
103 |
104 | state: {
105 | // 用户信息数据
106 | userData: sessionStorage.getItem('userData') ? JSON.parse(sessionStorage.getItem('userData')) : {},
107 | // 是否登陆
108 | isLogin: sessionStorage.getItem('userData') ? true : false,
109 | // 角色权限集合
110 | roles: []
111 | }
112 |
113 | 3. 路由鉴权 (根据登录接口返回的权限集合 生产动态路由)
114 |
115 | // 一级栏目
116 | {
117 | path: "/form",
118 | name: "form",
119 | component: Main,
120 | meta: {
121 | hide: false, // 是否显示
122 | title: "Dashboard", // 显示文字
123 | icon: "md-speedometer", // 显示图标
124 | roleId: 8,// 权限id
125 | },
126 | // 二级栏目
127 | children: [
128 | {
129 | path: "/form/basic_form",
130 | name: "basic-form",
131 | meta: {
132 | hide: false, // 是否显示
133 | title: "基础表单", // 显示文字
134 | roleId: 9, // 权限 数组
135 | },
136 | component: () => import("@/views/form/basic_form")
137 | }
138 | ]
139 | }
140 | 4. 路由权限测试
141 |
142 | 测试权限需要登录不同账户
143 | test账户 账号:test 密码:123456
144 | admin账户 账号:admin 密码:123456
145 |
146 | 说明:根据登录接口返回
147 | admin 拥有1-10的权限[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
148 | test 拥有6-10的权限[6, 7, 8, 9, 10]
149 |
150 | ### git地址
151 | 码云 https://gitee.com/zengxiaohui2019/Hui-Admin-Template
152 |
153 | GitHub https://github.com/zengxiaohui2019/Hui-Admin-Template
154 |
155 | ### 效果
156 |
157 | 在线演示:https://github.zengxiaohui.com/Hui-Admin-Template
158 | 
159 | 
160 |
161 | ### 支持作者
162 |
163 | 1. 本软件Hui-Admin-Template,是一个完全免费开源的产品,您可以任意使用,包括修订、发布、出售等。
164 | 2. 如果你觉得它给你的项目带来了帮助,提高了开发效率,您可以通过以下的方式来表示你的谢意!
165 | 3. 网站程序开发、管理系统、小程序开发请找我,WeiXin:badiweier 昵称:[曾小晖]
166 |
167 | 4. 使用 支付宝 或 微信 请我喝杯咖啡
168 |
169 | 
170 |
171 | ### 免责申明
172 |
173 | 1. 本软件代码全为曾小晖本人手写,不存在侵犯任何第三方著作权。
174 | 2. 禁止使用本软件从事违法犯罪的事情,在使用时产生的任何法律刑事责任于本软件无关 (想不出来能做什么违法的事情,但还是要申明一下)。
175 | 3. 由于个人才识技术浅薄,在使用本软件造成的一切损失于本软件无关 (应该不存在,只是一个前端页面而已)。
176 | 4. 有问题可联系本人 (大前提:请先百度尝试解决后最终没有找到解决办法),可付费或免费获得支持。
177 |
178 | ### 项目使用图片版权说明
179 |
180 | 1. 本项目使用的图片来源网络,版权归原作者所有
181 | 2. 由于没有联系到原作者,若涉及版权问题,请联系本人,予以删除,谢谢
182 |
--------------------------------------------------------------------------------
/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: [
3 | '@vue/app'
4 | ]
5 | }
6 |
--------------------------------------------------------------------------------
/other/admin1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zengxiaohui2019/Hui-Admin-Template/48a38f8acd2db67fc25ef73f051f30c6881e049e/other/admin1.jpg
--------------------------------------------------------------------------------
/other/admin2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zengxiaohui2019/Hui-Admin-Template/48a38f8acd2db67fc25ef73f051f30c6881e049e/other/admin2.jpg
--------------------------------------------------------------------------------
/other/skm.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zengxiaohui2019/Hui-Admin-Template/48a38f8acd2db67fc25ef73f051f30c6881e049e/other/skm.jpg
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "hui-admin-template",
3 | "version": "2.1.1",
4 | "private": true,
5 | "scripts": {
6 | "dev": "vue-cli-service serve",
7 | "build": "vue-cli-service build"
8 | },
9 | "dependencies": {
10 | "axios": "^0.19.0",
11 | "babel-polyfill": "^6.26.0",
12 | "core-js": "^2.6.5",
13 | "view-design": "^4.0.0",
14 | "mockjs": "^1.0.1-beta3",
15 | "moment": "^2.24.0",
16 | "vue": "^2.6.10",
17 | "vue-router": "^3.0.3",
18 | "vuex": "^3.0.1"
19 | },
20 | "devDependencies": {
21 | "@vue/cli-plugin-babel": "^3.11.0",
22 | "@vue/cli-service": "^3.11.0",
23 | "less": "^3.0.4",
24 | "less-loader": "^5.0.0",
25 | "vue-template-compiler": "^2.6.10"
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/postcss.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | plugins: {
3 | autoprefixer: {}
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zengxiaohui2019/Hui-Admin-Template/48a38f8acd2db67fc25ef73f051f30c6881e049e/public/favicon.ico
--------------------------------------------------------------------------------
/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |