├── .gitattributes
├── .gitignore
├── README.md
├── drug-vue
├── .gitignore
├── babel.config.js
├── package-lock.json
├── package.json
├── public
│ ├── favicon.ico
│ └── index.html
├── src
│ ├── App.vue
│ ├── assets
│ │ ├── 404_images
│ │ │ ├── 403.jpg
│ │ │ ├── 404.jpg
│ │ │ ├── 404.png
│ │ │ ├── 404_cloud.png
│ │ │ └── 500.jpg
│ │ └── theme-icon.png
│ ├── components
│ │ ├── headNav.vue
│ │ └── leftSide.vue
│ ├── http.js
│ ├── js
│ │ ├── customer
│ │ │ └── customerTypeList.js
│ │ ├── dbBackLog
│ │ │ └── list.js
│ │ ├── drug
│ │ │ ├── list.js
│ │ │ └── typeList.js
│ │ ├── goods
│ │ │ └── list.js
│ │ ├── goodsStorage
│ │ │ └── list.js
│ │ ├── goodsStorageLog
│ │ │ └── list.js
│ │ ├── index
│ │ │ └── index.js
│ │ ├── login
│ │ │ └── login.js
│ │ ├── permission
│ │ │ └── list.js
│ │ ├── register
│ │ │ └── list.js
│ │ ├── role
│ │ │ └── list.js
│ │ ├── roomSend
│ │ │ └── list.js
│ │ ├── roomStorage
│ │ │ └── list.js
│ │ ├── roomStorageLog
│ │ │ └── list.js
│ │ ├── storage
│ │ │ └── list.js
│ │ ├── storageLog
│ │ │ └── list.js
│ │ ├── user
│ │ │ └── list.js
│ │ └── userLoginLog
│ │ │ └── list.js
│ ├── main.js
│ ├── router
│ │ └── index.js
│ ├── store
│ │ └── index.js
│ ├── styles
│ │ └── reset.css
│ └── views
│ │ ├── login
│ │ └── index.vue
│ │ ├── permission
│ │ └── permission.js
│ │ ├── register
│ │ └── list.vue
│ │ ├── roomSend
│ │ └── list.vue
│ │ ├── roomStorage
│ │ └── list.vue
│ │ ├── roomStorageLog
│ │ └── list.vue
│ │ ├── storage
│ │ └── list.vue
│ │ └── storageLog
│ │ └── list.vue
└── vue.config.js
├── drug
├── .gitignore
├── pom.xml
└── src
│ ├── main
│ ├── java
│ │ └── com
│ │ │ └── drug
│ │ │ ├── Application.java
│ │ │ ├── api
│ │ │ ├── APIResult.java
│ │ │ ├── ResultCode.java
│ │ │ ├── ResultSupport.java
│ │ │ ├── request
│ │ │ │ ├── BaseRequest.java
│ │ │ │ └── BaseResponse.java
│ │ │ └── response
│ │ │ │ ├── CommonPageRequest.java
│ │ │ │ └── CommonPageResponse.java
│ │ │ ├── common
│ │ │ └── Constant.java
│ │ │ ├── config
│ │ │ ├── ConfigBeanValue.java
│ │ │ ├── MybatisPlusConfig.java
│ │ │ ├── TransactionAdviceConfig.java
│ │ │ ├── filter
│ │ │ │ ├── CorsConfig.java
│ │ │ │ └── MyWebFilter.java
│ │ │ └── secure
│ │ │ │ ├── MyAuthenticationDetailsSource.java
│ │ │ │ ├── MyUserDetailsService.java
│ │ │ │ ├── MyWebAuthenticationDetails.java
│ │ │ │ ├── RbacService.java
│ │ │ │ ├── RbacServiceImpl.java
│ │ │ │ └── WebSecurityConfig.java
│ │ │ ├── dao
│ │ │ ├── customer
│ │ │ │ └── CustomerTypeMapper.java
│ │ │ ├── db
│ │ │ │ └── DBMapper.java
│ │ │ ├── drug
│ │ │ │ ├── DrugMapper.java
│ │ │ │ └── DrugTypeMapper.java
│ │ │ ├── goods
│ │ │ │ ├── GoodsMapper.java
│ │ │ │ ├── GoodsStorageLogMapper.java
│ │ │ │ └── GoodsStorageMapper.java
│ │ │ ├── register
│ │ │ │ └── RegisterMapper.java
│ │ │ ├── room
│ │ │ │ ├── RoomSendMapper.java
│ │ │ │ ├── RoomStorageLogMapper.java
│ │ │ │ └── RoomStorageMapper.java
│ │ │ ├── storage
│ │ │ │ ├── StorageLogMapper.java
│ │ │ │ └── StorageMapper.java
│ │ │ └── user
│ │ │ │ ├── PermissionMapper.java
│ │ │ │ ├── RoleMapper.java
│ │ │ │ ├── RolePermissionMapper.java
│ │ │ │ ├── UserLoginLogMapper.java
│ │ │ │ ├── UserMapper.java
│ │ │ │ └── UserRoleMapper.java
│ │ │ ├── entity
│ │ │ ├── DBBackLog.java
│ │ │ ├── IdEntity.java
│ │ │ ├── customer
│ │ │ │ └── CustomerType.java
│ │ │ ├── drug
│ │ │ │ ├── Drug.java
│ │ │ │ └── DrugType.java
│ │ │ ├── enums
│ │ │ │ └── BaseEnum.java
│ │ │ ├── goods
│ │ │ │ ├── Goods.java
│ │ │ │ ├── GoodsOperatorTypeEnum.java
│ │ │ │ ├── GoodsStorage.java
│ │ │ │ └── GoodsStorageLog.java
│ │ │ ├── register
│ │ │ │ └── Register.java
│ │ │ ├── room
│ │ │ │ ├── RoomOperatorTypeEnum.java
│ │ │ │ ├── RoomSend.java
│ │ │ │ ├── RoomStorage.java
│ │ │ │ └── RoomStorageLog.java
│ │ │ ├── storage
│ │ │ │ ├── DrugStorage.java
│ │ │ │ ├── DrugStorageLog.java
│ │ │ │ └── StorageOperatorTypeEnum.java
│ │ │ └── user
│ │ │ │ ├── Permission.java
│ │ │ │ ├── Role.java
│ │ │ │ ├── RolePermission.java
│ │ │ │ ├── User.java
│ │ │ │ ├── UserLoginLog.java
│ │ │ │ └── UserRole.java
│ │ │ ├── service
│ │ │ ├── customer
│ │ │ │ ├── CustomerTypeService.java
│ │ │ │ └── impl
│ │ │ │ │ └── CustomerTypeServiceImpl.java
│ │ │ ├── db
│ │ │ │ ├── DBService.java
│ │ │ │ └── impl
│ │ │ │ │ └── DBServiceImpl.java
│ │ │ ├── drug
│ │ │ │ ├── DrugService.java
│ │ │ │ ├── DrugTypeService.java
│ │ │ │ └── impl
│ │ │ │ │ ├── DrugServiceImpl.java
│ │ │ │ │ └── DrugTypeServiceImpl.java
│ │ │ ├── goods
│ │ │ │ ├── GoodsService.java
│ │ │ │ ├── GoodsStorageLogService.java
│ │ │ │ ├── GoodsStorageService.java
│ │ │ │ └── impl
│ │ │ │ │ ├── GoodsServiceImpl.java
│ │ │ │ │ ├── GoodsStorageLogServiceImpl.java
│ │ │ │ │ └── GoodsStorageServiceImpl.java
│ │ │ ├── register
│ │ │ │ ├── RegisterService.java
│ │ │ │ └── impl
│ │ │ │ │ └── RegisterServiceImpl.java
│ │ │ ├── room
│ │ │ │ ├── RoomSendService.java
│ │ │ │ ├── RoomStorageLogService.java
│ │ │ │ ├── RoomStorageService.java
│ │ │ │ └── impl
│ │ │ │ │ ├── RoomSendServiceImpl.java
│ │ │ │ │ ├── RoomStorageLogServiceImpl.java
│ │ │ │ │ └── RoomStorageServiceImpl.java
│ │ │ ├── storage
│ │ │ │ ├── StorageLogService.java
│ │ │ │ ├── StorageService.java
│ │ │ │ └── impl
│ │ │ │ │ ├── StorageLogServiceImpl.java
│ │ │ │ │ └── StorageServiceImpl.java
│ │ │ └── user
│ │ │ │ ├── PermissionService.java
│ │ │ │ ├── RolePermissionService.java
│ │ │ │ ├── RoleService.java
│ │ │ │ ├── UserLoginLogService.java
│ │ │ │ ├── UserService.java
│ │ │ │ └── impl
│ │ │ │ ├── PermissionServiceImpl.java
│ │ │ │ ├── RolePermissionServiceImpl.java
│ │ │ │ ├── RoleServiceImpl.java
│ │ │ │ ├── UserLoginLogServiceImpl.java
│ │ │ │ └── UserServiceImpl.java
│ │ │ ├── utils
│ │ │ ├── Collections.java
│ │ │ └── UserUtil.java
│ │ │ └── web
│ │ │ ├── common
│ │ │ └── BaseCtrl.java
│ │ │ ├── customer
│ │ │ └── CustomerTypeCtrl.java
│ │ │ ├── db
│ │ │ └── DbCtrl.java
│ │ │ ├── drug
│ │ │ ├── DrugCtrl.java
│ │ │ ├── DrugTypeCtrl.java
│ │ │ ├── request
│ │ │ │ └── DrugRequest.java
│ │ │ └── response
│ │ │ │ └── DrugResponse.java
│ │ │ ├── goods
│ │ │ ├── GoodsCtrl.java
│ │ │ ├── GoodsStorageCtrl.java
│ │ │ ├── GoodsStorageLogCtrl.java
│ │ │ ├── request
│ │ │ │ ├── GoodsRequest.java
│ │ │ │ ├── GoodsStorageLogSearchParamRequest.java
│ │ │ │ └── GoodsStorageSearchParamRequest.java
│ │ │ └── response
│ │ │ │ ├── GoodsResponse.java
│ │ │ │ └── GoodsStorageOperatorTypeEnumResponse.java
│ │ │ ├── nacos
│ │ │ └── ConfigController.java
│ │ │ ├── register
│ │ │ ├── RegisterCtrl.java
│ │ │ ├── request
│ │ │ │ └── RegisterRequest.java
│ │ │ └── response
│ │ │ │ └── RegisterResponse.java
│ │ │ ├── room
│ │ │ ├── RoomSendCtrl.java
│ │ │ ├── RoomStorageCtrl.java
│ │ │ ├── RoomStorageLogCtrl.java
│ │ │ ├── request
│ │ │ │ ├── RoomSendRequest.java
│ │ │ │ ├── RoomSendSearchParamRequest.java
│ │ │ │ ├── RoomStorageLogSearchParamRequest.java
│ │ │ │ └── RoomStorageSearchParamRequest.java
│ │ │ └── response
│ │ │ │ └── RoomStorageOperatorTypeEnumResponse.java
│ │ │ ├── storage
│ │ │ ├── StorageCtrl.java
│ │ │ ├── StorageLogCtrl.java
│ │ │ ├── request
│ │ │ │ ├── StorageLogSearchParamRequest.java
│ │ │ │ └── StorageSearchParamRequest.java
│ │ │ └── response
│ │ │ │ ├── StorageChartsResponse.java
│ │ │ │ └── StorageOperatorTypeEnumResponse.java
│ │ │ └── user
│ │ │ ├── PermissionCtrl.java
│ │ │ ├── RoleCtrl.java
│ │ │ ├── UserCtrl.java
│ │ │ ├── request
│ │ │ ├── PermissionRequest.java
│ │ │ ├── RolePermissionRequest.java
│ │ │ ├── RoleRequest.java
│ │ │ ├── UserCheckNameRequest.java
│ │ │ ├── UserPasswordRequest.java
│ │ │ ├── UserRequest.java
│ │ │ └── UserThemeRequest.java
│ │ │ └── response
│ │ │ ├── PermissionParentResponse.java
│ │ │ ├── PermissionResponse.java
│ │ │ ├── PermissionTotalResponse.java
│ │ │ ├── RolePermissionResponse.java
│ │ │ ├── UserFromResponse.java
│ │ │ └── UserResponse.java
│ └── resources
│ │ └── application.properties
│ └── test
│ └── java
│ ├── CodeReviewTest.java
│ └── com
│ └── NewCodeReviewTest.java
└── picture
├── picture1.png
├── picture10.png
├── picture11.png
├── picture12.png
├── picture13.png
├── picture14.png
├── picture15.png
├── picture16.png
├── picture17.png
├── picture18.png
├── picture19.png
├── picture2.png
├── picture20.png
├── picture21.png
├── picture22.png
├── picture23.png
├── picture3.png
├── picture4.png
├── picture5.png
├── picture6.png
├── picture7.png
├── picture8.png
└── picture9.png
/.gitattributes:
--------------------------------------------------------------------------------
1 | *.js linguist-language=java
2 | *.css linguist-language=java
3 | *.html linguist-language=java
4 | *.vue linguist-language=java
5 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /out/
2 | !.mvn/wrapper/maven-wrapper.jar
3 | *.zip
4 | *.docs
5 | /drug/target/
6 | /drug-vue/node_modules/
7 | ### STS ###
8 | .apt_generated
9 | .classpath
10 | .factorypath
11 | .project
12 | .settings
13 | .springBeans
14 | .sts4-cache
15 |
16 | ### IntelliJ IDEA ###
17 | .idea
18 | *.iws
19 | *.iml
20 | *.ipr
21 | .mvn
22 | mvnw
23 | mvnw.cmd
24 |
25 | ### NetBeans ###
26 | /nbproject/private/
27 | /build/
28 | /nbbuild/
29 | /dist/
30 | /nbdist/
31 | /.nb-gradle/
32 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ## 基于Java+Springboot+vue的药店管理系统(源码+数据库)103
2 |
3 | ## 一、系统介绍
4 | 本系统前后端分离
5 |
6 | -功能:
7 | 登录、药库药品管理、统计查询、药房管理、物资管理、挂号管理、账号管理、角色管理、权限管理、登录日志管理、药品管理、药品类型管理、客人类型管理
8 |
9 |
10 | ## 二、所用技术
11 | 后端技术栈:
12 | - Springboot
13 | - SpringMvc
14 | - mybatisPlus
15 | - mysql
16 | - SpringSecurity
17 |
18 | 前端技术栈:
19 | - Vue
20 | - ElementUI
21 | - vue-router
22 | - axios
23 |
24 | ## 三、环境介绍
25 | 基础环境 :IDEA/eclipse, JDK 1.8, Mysql5.7及以上, Maven3.6, node.js(14版本)
26 |
27 | 所有项目以及源代码本人均调试运行无问题 可支持远程调试运行
28 |
29 | ## 四、页面截图
30 | ### 1、功能页面
31 | 
32 | 
33 | 
34 | 
35 | 
36 | 
37 | 
38 | 
39 | 
40 | 
41 | 
42 | 
43 | 
44 | 
45 | 
46 | 
47 | 
48 | 
49 | 
50 | 
51 | 
52 | 
53 | 
54 |
55 | ## 五、浏览地址
56 | - 前台访问路径:http://localhost:8889
57 | 账号密码:admin/123456
58 |
59 | ## 六、安装教程
60 |
61 | 1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并执行项目的sql
62 |
63 | 2. 使用IDEA/Eclipse导入drug项目,导入时,若为maven项目请选择maven; 等待依赖下载完成
64 |
65 | 3. 修改resources目录下面application.properties里面的数据库配置和文件路径配置
66 |
67 | 4. com/drug/Application.java启动后端项目
68 |
69 | 5. vscode或idea打开drug-vue项目
70 |
71 | 6. 在编译器中打开terminal,执行npm install 依赖下载完成后执行 npm run serve,执行成功后会显示前台访问地址
72 |
73 |
74 |
75 |
--------------------------------------------------------------------------------
/drug-vue/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules
3 | /dist
4 |
5 |
6 | # local env files
7 | .env.local
8 | .env.*.local
9 |
10 | # Log files
11 | npm-debug.log*
12 | yarn-debug.log*
13 | yarn-error.log*
14 | pnpm-debug.log*
15 |
16 | # Editor directories and files
17 | .idea
18 | .vscode
19 | *.suo
20 | *.ntvs*
21 | *.njsproj
22 | *.sln
23 | *.sw?
24 |
--------------------------------------------------------------------------------
/drug-vue/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: [
3 | '@vue/cli-plugin-babel/preset'
4 | ]
5 | }
6 |
--------------------------------------------------------------------------------
/drug-vue/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "drug",
3 | "version": "0.1.0",
4 | "private": true,
5 | "scripts": {
6 | "serve": "vue-cli-service serve",
7 | "build": "vue-cli-service build"
8 | },
9 | "dependencies": {
10 | "axios": "^0.21.1",
11 | "core-js": "^3.6.5",
12 | "echarts": "^4.9.0",
13 | "element-ui": "^2.13.2",
14 | "v-charts": "^1.19.0",
15 | "v-echarts": "^1.0.2",
16 | "vue": "^2.6.11",
17 | "vue-particles": "^1.0.9",
18 | "vue-router": "^3.2.0",
19 | "vuex": "^3.4.0",
20 | "vuex-persistedstate": "^4.0.0-beta.1"
21 | },
22 | "devDependencies": {
23 | "@vue/cli-plugin-babel": "~4.5.0",
24 | "@vue/cli-plugin-router": "~4.5.0",
25 | "@vue/cli-plugin-vuex": "~4.5.0",
26 | "@vue/cli-service": "~4.5.0",
27 | "node-loader": "^1.0.2",
28 | "node-sass": "^5.0.0",
29 | "sass-loader": "^10.1.0",
30 | "vue-template-compiler": "^2.6.11"
31 | },
32 | "browserslist": [
33 | "> 1%",
34 | "last 2 versions",
35 | "not dead"
36 | ]
37 | }
38 |
--------------------------------------------------------------------------------
/drug-vue/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/giteecode/drugManage/18855f9dfe0a0b7f3a1d7fe0fce6a92d0b0412ec/drug-vue/public/favicon.ico
--------------------------------------------------------------------------------
/drug-vue/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | <%= htmlWebpackPlugin.options.title %>
9 |
10 |
11 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/drug-vue/src/App.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
23 |
25 |
--------------------------------------------------------------------------------
/drug-vue/src/assets/404_images/403.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/giteecode/drugManage/18855f9dfe0a0b7f3a1d7fe0fce6a92d0b0412ec/drug-vue/src/assets/404_images/403.jpg
--------------------------------------------------------------------------------
/drug-vue/src/assets/404_images/404.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/giteecode/drugManage/18855f9dfe0a0b7f3a1d7fe0fce6a92d0b0412ec/drug-vue/src/assets/404_images/404.jpg
--------------------------------------------------------------------------------
/drug-vue/src/assets/404_images/404.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/giteecode/drugManage/18855f9dfe0a0b7f3a1d7fe0fce6a92d0b0412ec/drug-vue/src/assets/404_images/404.png
--------------------------------------------------------------------------------
/drug-vue/src/assets/404_images/404_cloud.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/giteecode/drugManage/18855f9dfe0a0b7f3a1d7fe0fce6a92d0b0412ec/drug-vue/src/assets/404_images/404_cloud.png
--------------------------------------------------------------------------------
/drug-vue/src/assets/404_images/500.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/giteecode/drugManage/18855f9dfe0a0b7f3a1d7fe0fce6a92d0b0412ec/drug-vue/src/assets/404_images/500.jpg
--------------------------------------------------------------------------------
/drug-vue/src/assets/theme-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/giteecode/drugManage/18855f9dfe0a0b7f3a1d7fe0fce6a92d0b0412ec/drug-vue/src/assets/theme-icon.png
--------------------------------------------------------------------------------
/drug-vue/src/http.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 | import router from './router'
3 | const url = 'http://localhost:8888'/*设置全局请求地址*/
4 |
5 |
6 | //请求拦截
7 | axios.interceptors.request.use(config => {
8 | if (config.url.indexOf(url) === -1) {
9 | config.url = url + config.url; /*拼接完整请求路径*/
10 | }
11 | if (config.url.indexOf("login") == -1) {
12 | const token = localStorage.getItem("auth-token");
13 | config.headers['auth-token'] = token /*设置统一请求头*/
14 | }
15 | return config
16 | }, error => {
17 | return Promise.reject(error)
18 | });
19 |
20 | //响应拦截
21 | axios.interceptors.response.use(
22 | response => {
23 | return response;
24 | },
25 | error => {
26 | const { status } = error.response;
27 | console.log(status);
28 | switch (status) {
29 | case 401:
30 | localStorage.removeItem('auth-token'); //清除token
31 | router.replace('/login')//跳转登陆页面
32 | break;
33 | case 403:
34 | router.replace('/error/403')
35 | break;
36 | case 500:
37 | router.replace('/error/500')
38 | break;
39 | case 404:
40 | router.replace('/error/404')
41 | break;
42 | default:
43 | router.replace('/error/500')
44 | break;
45 | }
46 | return Promise.reject(error)
47 | }
48 | );
49 |
50 | export default axios;
51 |
52 |
53 |
--------------------------------------------------------------------------------
/drug-vue/src/js/customer/customerTypeList.js:
--------------------------------------------------------------------------------
1 | export default {
2 | name: "customerTypeList",
3 | data() {
4 | return {
5 | queryinfo: {
6 | currentPage: 1,
7 | keyword: "",
8 | pageSize: 10,
9 | },
10 | tableData: [],
11 | total: 0,
12 | dialog: {
13 | title: "",
14 | show: false,
15 | },
16 | newForm: {
17 | },
18 | rules: {
19 | name: [{ required: true, message: "请输入类型", trigger: "blur" }],
20 | },
21 | data: [],
22 | };
23 | },
24 | created() {
25 | this.createParams();
26 | },
27 | methods: {
28 | //初始化数据
29 | createParams() {
30 | //加载列表
31 | this.$axios
32 | .post("/customerType/list/page/", this.queryinfo)
33 | .then((res) => {
34 | if (res.data != null && res.data != "") {
35 | this.tableData = res.data.records;
36 | this.total = res.data.total;
37 | } else {
38 | this.$message.error("获取列表失败!");
39 | }
40 | })
41 | .catch((err) => {
42 | console.log("报错了" + err);
43 | });
44 | },
45 | //展开新建弹框
46 | newObj() {
47 | this.dialog = {
48 | title: "新建客人类型",
49 | show: true,
50 | };
51 | },
52 |
53 | //展开编辑弹框
54 | edit(id) {
55 | this.dialog = {
56 | title: "编辑客人类型",
57 | show: true,
58 | };
59 | this.$axios
60 | .get("/customerType/loadDetail/" + id + "/")
61 | .then((res) => {
62 | this.newForm = res.data;
63 | })
64 | .catch((err) => {
65 | console.log("报错了" + err);
66 | });
67 | },
68 | //保存弹框
69 | submitForm(formName) {
70 | this.$refs[formName].validate((valid) => {
71 | if (valid) {
72 | this.$axios
73 | .post("/customerType/save/", this.newForm)
74 | .then((res) => {
75 | if (res.data != null && res.data != "") {
76 | this.$message({
77 | type: "success",
78 | message: "保存成功!",
79 | });
80 | this.dialog.show = false;
81 | this.createParams();
82 | } else {
83 | this.$message.error("保存失败!");
84 | }
85 | })
86 | .catch((err) => {
87 | console.log("报错了" + err);
88 | });
89 | } else {
90 | console.log("error submit!");
91 | return false;
92 | }
93 | });
94 | },
95 | //关闭弹框
96 | addDialogClosed() {
97 | this.$refs.newForm.resetFields();
98 | //初始化数据
99 | this.newForm = {
100 | };
101 | },
102 | // 监听 pagesize 改变的事件
103 | handleSizeChange(newSize) {
104 | // console.log(newSize)
105 | this.queryinfo.pageSize = newSize;
106 | this.createParams();
107 | },
108 | // 监听 页码值 改变的事件
109 | handleCurrentChange(newPage) {
110 | //console.log(newPage)
111 | this.queryinfo.currentPage = newPage;
112 | this.createParams();
113 | },
114 | },
115 | };
--------------------------------------------------------------------------------
/drug-vue/src/js/dbBackLog/list.js:
--------------------------------------------------------------------------------
1 | export default {
2 | name: "dbBackLog",
3 | data() {
4 | return {
5 | queryinfo: {
6 | currentPage: 1,
7 | keyword: "",
8 | pageSize: 10,
9 | },
10 | tableData: [],
11 | total: 0,
12 | data: []
13 | };
14 | },
15 | created() {
16 | this.createParams();
17 | },
18 | methods: {
19 | //初始化数据
20 | createParams() {
21 | //加载列表
22 | this.$axios
23 | .post("/db/list/page/", this.queryinfo)
24 | .then((res) => {
25 | if (res.data != null && res.data != "") {
26 | this.tableData = res.data.records;
27 | this.total = res.data.total;
28 | } else {
29 | this.$message.error("获取列表失败!");
30 | }
31 | })
32 | .catch((err) => {
33 | console.log("报错了" + err);
34 | });
35 | },
36 | createDBBack() {
37 | this.$axios
38 | .get("/db/create/")
39 | .then((res) => {
40 | this.$message({
41 | type: "success",
42 | message: "数据库备份成功!目录为默认 C:/drug..",
43 | });
44 | this.createParams();
45 | })
46 | .catch((err) => {
47 | console.log("报错了" + err);
48 | });
49 | },
50 | // 监听 pagesize 改变的事件
51 | handleSizeChange(newSize) {
52 | // console.log(newSize)
53 | this.queryinfo.pageSize = newSize;
54 | this.createParams();
55 | },
56 | // 监听 页码值 改变的事件
57 | handleCurrentChange(newPage) {
58 | //console.log(newPage)
59 | this.queryinfo.currentPage = newPage;
60 | this.createParams();
61 | },
62 | },
63 | };
--------------------------------------------------------------------------------
/drug-vue/src/js/drug/typeList.js:
--------------------------------------------------------------------------------
1 | export default {
2 | name: "drugTypeList",
3 | data() {
4 | return {
5 | queryinfo: {
6 | currentPage: 1,
7 | keyword: "",
8 | pageSize: 10,
9 | },
10 | tableData: [],
11 | total: 0,
12 | dialog: {
13 | title: "",
14 | show: false,
15 | },
16 | newForm: {
17 | },
18 | rules: {
19 | name: [{ required: true, message: "请输入剂型名", trigger: "blur" }],
20 | },
21 | data: [],
22 | };
23 | },
24 | created() {
25 | this.createParams();
26 | },
27 | methods: {
28 | //初始化数据
29 | createParams() {
30 | //加载列表
31 | this.$axios
32 | .post("/drugType/list/page/", this.queryinfo)
33 | .then((res) => {
34 | if (res.data != null && res.data != "") {
35 | this.tableData = res.data.records;
36 | this.total = res.data.total;
37 | } else {
38 | this.$message.error("获取列表失败!");
39 | }
40 | })
41 | .catch((err) => {
42 | console.log("报错了" + err);
43 | });
44 | },
45 | //展开新建弹框
46 | newObj() {
47 | this.dialog = {
48 | title: "新建剂型",
49 | show: true,
50 | };
51 | },
52 |
53 | //展开编辑弹框
54 | edit(id) {
55 | this.dialog = {
56 | title: "编辑剂型",
57 | show: true,
58 | };
59 | this.$axios
60 | .get("/drugType/loadDetail/" + id + "/")
61 | .then((res) => {
62 | this.newForm = res.data;
63 | })
64 | .catch((err) => {
65 | console.log("报错了" + err);
66 | });
67 | },
68 | //保存弹框
69 | submitForm(formName) {
70 | this.$refs[formName].validate((valid) => {
71 | if (valid) {
72 | this.$axios
73 | .post("/drugType/save/", this.newForm)
74 | .then((res) => {
75 | if (res.data != null && res.data != "") {
76 | this.$message({
77 | type: "success",
78 | message: "保存成功!",
79 | });
80 | this.dialog.show = false;
81 | this.createParams();
82 | } else {
83 | this.$message.error("保存失败!");
84 | }
85 | })
86 | .catch((err) => {
87 | console.log("报错了" + err);
88 | });
89 | } else {
90 | console.log("error submit!");
91 | return false;
92 | }
93 | });
94 | },
95 | //关闭弹框
96 | addDialogClosed() {
97 | this.$refs.newForm.resetFields();
98 | //初始化数据
99 | this.newForm = {
100 | };
101 | },
102 | // 监听 pagesize 改变的事件
103 | handleSizeChange(newSize) {
104 | // console.log(newSize)
105 | this.queryinfo.pageSize = newSize;
106 | this.createParams();
107 | },
108 | // 监听 页码值 改变的事件
109 | handleCurrentChange(newPage) {
110 | //console.log(newPage)
111 | this.queryinfo.currentPage = newPage;
112 | this.createParams();
113 | },
114 | },
115 | };
--------------------------------------------------------------------------------
/drug-vue/src/js/goods/list.js:
--------------------------------------------------------------------------------
1 | export default {
2 | name: "goodsList",
3 | data() {
4 | return {
5 | queryinfo: {
6 | currentPage: 1,
7 | keyword: "",
8 | pageSize: 10,
9 | },
10 | tableData: [],
11 | total: 0,
12 | dialog: {
13 | title: "",
14 | show: false,
15 | },
16 | newForm: {
17 | },
18 | rules: {
19 | name: [{ required: true, message: "请输入物资名", trigger: "blur" }],
20 | },
21 | types: [],
22 | data: [],
23 | };
24 | },
25 | created() {
26 | this.createParams();
27 | },
28 | methods: {
29 | //初始化数据
30 | createParams() {
31 | //加载列表
32 | this.$axios
33 | .post("/goods/list/page/", this.queryinfo)
34 | .then((res) => {
35 | if (res.data != null && res.data != "") {
36 | this.tableData = res.data.records;
37 | this.total = res.data.total;
38 | } else {
39 | this.$message.error("获取列表失败!");
40 | }
41 | })
42 | .catch((err) => {
43 | console.log("报错了" + err);
44 | });
45 | },
46 | //展开新建弹框
47 | newRole() {
48 | this.dialog = {
49 | title: "新建物资",
50 | show: true,
51 | };
52 | },
53 |
54 | //展开编辑弹框
55 | edit(id) {
56 | this.dialog = {
57 | title: "编辑物资",
58 | show: true,
59 | };
60 | this.$axios
61 | .get("/goods/loadDetail/" + id + "/")
62 | .then((res) => {
63 | this.newForm = res.data.goods;
64 | })
65 | .catch((err) => {
66 | console.log("报错了" + err);
67 | });
68 | },
69 | //保存
70 | submitForm(formName) {
71 | this.$refs[formName].validate((valid) => {
72 | if (valid) {
73 | this.$axios
74 | .post("/goods/save/", this.newForm)
75 | .then((res) => {
76 | if (res.data != null && res.data != "") {
77 | this.$message({
78 | type: "success",
79 | message: "保存成功!",
80 | });
81 | this.dialog.show = false;
82 | this.createParams();
83 | } else {
84 | this.$message.error("保存失败!");
85 | }
86 | })
87 | .catch((err) => {
88 | console.log("报错了" + err);
89 | });
90 | } else {
91 | console.log("error submit!");
92 | return false;
93 | }
94 | });
95 | },
96 | //关闭弹框
97 | addDialogClosed() {
98 | this.$refs.newForm.resetFields();
99 | //初始化数据
100 | this.newForm = {
101 | };
102 | },
103 | // 监听 pagesize 改变的事件
104 | handleSizeChange(newSize) {
105 | // console.log(newSize)
106 | this.queryinfo.pageSize = newSize;
107 | this.createParams();
108 | },
109 | // 监听 页码值 改变的事件
110 | handleCurrentChange(newPage) {
111 | //console.log(newPage)
112 | this.queryinfo.currentPage = newPage;
113 | this.createParams();
114 | },
115 | },
116 | };
--------------------------------------------------------------------------------
/drug-vue/src/js/goodsStorage/list.js:
--------------------------------------------------------------------------------
1 | export default {
2 | name: "goodsStorageList",
3 | data() {
4 | return {
5 | queryinfo: {
6 | currentPage: 1,
7 | keyword: "",
8 | pageSize: 10,
9 | },
10 | tableData: [],
11 | total: 0,
12 | dialog: {
13 | title: "",
14 | show: false,
15 | },
16 | newForm: {
17 | },
18 | // rules: {
19 | // validityBeginTime: [{ required: true, message: "请输入有效期结束时间", trigger: "blur" }],
20 | // },
21 | data: [],
22 | };
23 | },
24 | created() {
25 | this.createParams();
26 | },
27 | methods: {
28 | //初始化数据
29 | createParams() {
30 | //加载列表
31 | this.$axios
32 | .post("/goodsStorage/list/page/", this.queryinfo)
33 | .then((res) => {
34 | if (res.data != null && res.data != "") {
35 | this.tableData = res.data.records;
36 | this.total = res.data.total;
37 | } else {
38 | this.$message.error("获取列表失败!");
39 | }
40 | })
41 | .catch((err) => {
42 | console.log("报错了" + err);
43 | });
44 | },
45 |
46 | // 监听 pagesize 改变的事件
47 | handleSizeChange(newSize) {
48 | // console.log(newSize)
49 | this.queryinfo.pageSize = newSize;
50 | this.createParams();
51 | },
52 | // 监听 页码值 改变的事件
53 | handleCurrentChange(newPage) {
54 | //console.log(newPage)
55 | this.queryinfo.currentPage = newPage;
56 | this.createParams();
57 | },
58 | },
59 | };
--------------------------------------------------------------------------------
/drug-vue/src/js/index/index.js:
--------------------------------------------------------------------------------
1 | import headNav from "@/components/headNav";
2 | import leftSide from "@/components/leftSide";
3 | export default {
4 | name: "index",
5 | components: {
6 | headNav,
7 | leftSide,
8 | },
9 | data() {
10 | return {
11 | themeColor: "",
12 | breadList: null,
13 | };
14 | },
15 | created() {
16 | this.createParams();
17 | },
18 |
19 | methods: {
20 | //初始化主题数据
21 | createParams() {
22 | const id = JSON.parse(localStorage.getItem("auth-user")).id;
23 | this.$axios
24 | .get("/user/get/")
25 | .then((res) => {
26 | if (res.data != null && res.data != "") {
27 | if (res.data.theme == null || res.data.theme == "") {
28 | this.themeColor = "#29374c";
29 | } else {
30 | this.themeColor = res.data.theme;
31 | }
32 | }
33 | })
34 | .catch((err) => {
35 | console.log("报错了" + err);
36 | });
37 | },
38 | //修改主题颜色
39 | updateColor(updateColor) {
40 | this.$axios
41 | .post("/user/updateTheme/", {
42 | id: JSON.parse(localStorage.getItem("auth-user")).id,
43 | theme: updateColor,
44 | })
45 | .then((res) => {
46 | if (res.data != null && res.data != "") {
47 | this.$message({
48 | type: "success",
49 | message: "主题修改成功!",
50 | });
51 | this.themeColor = updateColor;
52 | this.createParams();
53 | }
54 | })
55 | .catch((err) => {
56 | console.log("报错了" + err);
57 | });
58 | },
59 | },
60 | };
--------------------------------------------------------------------------------
/drug-vue/src/js/login/login.js:
--------------------------------------------------------------------------------
1 |
2 | import { mapGetters } from "vuex";
3 | export default {
4 | name: "login",
5 | data() {
6 | return {
7 | loginUser: {
8 | username: "admin",
9 | password: "123456",
10 | },
11 | loginRules: {
12 | username: [
13 | {
14 | required: true,
15 | message: "用户名不能为空",
16 | trigger: "blur",
17 | },
18 | ],
19 | password: [
20 | {
21 | required: true,
22 | message: "密码不能为空",
23 | trigger: "blur",
24 | },
25 | ],
26 | },
27 | };
28 | },
29 | computed: {
30 | ...mapGetters(["bgColor", "themeUser"]),
31 | },
32 | methods: {
33 | submitForm(formName) {
34 | this.$refs[formName].validate((valid) => {
35 | if (valid) {
36 | var fd = new FormData();
37 | fd.append("username", this.loginUser.username);
38 | fd.append("password", this.loginUser.password);
39 | this.$axios
40 | .post("/user/login/", fd)
41 | .then((res) => {
42 | if (res.data != null && res.data != "") {
43 | this.$store.dispatch("setIsAutnenticated", true); //token存储到vuex
44 | //请求成功后的处理函数
45 | if(res.data != null && res.data != ""){
46 | this.logining = false;
47 | //如果返回成功则获取userInfo
48 | this.$axios.post(
49 | '/user/info/'
50 | )
51 | .then(res => {
52 | const user = res.data;
53 | localStorage.setItem("auth-user", JSON.stringify(user));
54 | this.$store.dispatch("setUser", user); //user存储到vuex
55 |
56 | this.$router.push({path: '/index'});
57 | }).catch(err => {//请求失败后的处理函数
58 | console.log(err);
59 | this.logining = false;
60 | });
61 | } else {
62 | this.$alert('账号或密码错误', '提示', {
63 | confirmButtonText: 'ok'
64 | })}
65 | }
66 | })
67 | .catch((err) => {
68 | this.$message({
69 | message: "账号或密码错误",
70 | type: "warning",
71 | });
72 | });
73 | } else {
74 | return false;
75 | }
76 | });
77 | },
78 | },
79 | };
--------------------------------------------------------------------------------
/drug-vue/src/js/register/list.js:
--------------------------------------------------------------------------------
1 | export default {
2 | name: "registerList",
3 | data() {
4 | return {
5 | queryinfo: {
6 | currentPage: 1,
7 | keyword: "",
8 | pageSize: 10,
9 | },
10 | tableData: [],
11 | total: 0,
12 | drugs : [],
13 | types : [],
14 | dialog: {
15 | title: "",
16 | show: false,
17 | },
18 | newForm: {
19 | },
20 | rules: {
21 | customerName: [{ required: true, message: "请选择药品", trigger: "blur" }],
22 | customerNo: [{ required: true, message: "请选择操作类型", trigger: "blur" }],
23 | },
24 | };
25 | },
26 | created() {
27 | this.createParams();
28 | },
29 | methods: {
30 | //初始化数据
31 | createParams() {
32 | //加载列表
33 | this.$axios
34 | .post("/register/list/page/", this.queryinfo)
35 | .then((res) => {
36 | if (res.data != null && res.data != "") {
37 | this.tableData = res.data.records;
38 | this.total = res.data.total;
39 | } else {
40 | this.$message.error("获取列表失败!");
41 | }
42 | })
43 | .catch((err) => {
44 | console.log("报错了" + err);
45 | });
46 | },
47 |
48 | //展开新建弹框
49 | newObj() {
50 | this.dialog = {
51 | title: "新建挂号操作",
52 | show: true,
53 | };
54 | this.$axios
55 | .get("/register/typeList/")
56 | .then((res) => {
57 | this.types = res.data;
58 | })
59 | .catch((err) => {
60 | console.log("报错了" + err);
61 | });
62 | },
63 |
64 | //展开编辑弹框
65 | edit(id) {
66 | this.dialog = {
67 | title: "编辑挂号",
68 | show: true,
69 | };
70 | this.$axios
71 | .get("/register/loadDetail/" + id + "/")
72 | .then((res) => {
73 | this.newForm = res.data;
74 | })
75 | .catch((err) => {
76 | console.log("报错了" + err);
77 | });
78 | },
79 |
80 | //保存弹框
81 | submitForm(formName) {
82 | this.$refs[formName].validate((valid) => {
83 | if (valid) {
84 | this.$axios
85 | .post("/register/save/", this.newForm)
86 | .then((res) => {
87 | if (res.data != null && res.data != "") {
88 | this.$message({
89 | type: "success",
90 | message: "保存成功!",
91 | });
92 | this.dialog.show = false;
93 | this.createParams();
94 | } else {
95 | this.$message.error("保存失败!");
96 | }
97 | })
98 | .catch((err) => {
99 | console.log("报错了" + err);
100 | });
101 | } else {
102 | console.log("error submit!");
103 | return false;
104 | }
105 | });
106 | },
107 | //关闭弹框
108 | addDialogClosed() {
109 | this.$refs.newForm.resetFields();
110 | //初始化数据
111 | this.newForm = {
112 | };
113 | },
114 | // 监听 pagesize 改变的事件
115 | handleSizeChange(newSize) {
116 | // console.log(newSize)
117 | this.queryinfo.pageSize = newSize;
118 | this.createParams();
119 | },
120 | // 监听 页码值 改变的事件
121 | handleCurrentChange(newPage) {
122 | //console.log(newPage)
123 | this.queryinfo.currentPage = newPage;
124 | this.createParams();
125 | },
126 | },
127 | };
--------------------------------------------------------------------------------
/drug-vue/src/js/roomStorage/list.js:
--------------------------------------------------------------------------------
1 | export default {
2 | name: "roomStorageList",
3 | data() {
4 | return {
5 | queryinfo: {
6 | currentPage: 1,
7 | keyword: "",
8 | pageSize: 10,
9 | },
10 | tableData: [],
11 | total: 0,
12 | dialog: {
13 | title: "",
14 | show: false,
15 | },
16 | newForm: {
17 | },
18 | rules: {
19 | validityEndTime: [{ required: true, message: "请输入有效期结束时间", trigger: "blur" }],
20 | },
21 | data: [],
22 | };
23 | },
24 | created() {
25 | this.createParams();
26 | },
27 | methods: {
28 | //初始化数据
29 | createParams() {
30 | //加载列表
31 | this.$axios
32 | .post("/roomStorage/list/page/", this.queryinfo)
33 | .then((res) => {
34 | if (res.data != null && res.data != "") {
35 | this.tableData = res.data.records;
36 | this.total = res.data.total;
37 | } else {
38 | this.$message.error("获取列表失败!");
39 | }
40 | })
41 | .catch((err) => {
42 | console.log("报错了" + err);
43 | });
44 | },
45 |
46 | //展开编辑弹框
47 | edit(id) {
48 | this.dialog = {
49 | title: "编辑有效期结束时间",
50 | show: true,
51 | };
52 | this.$axios
53 | .get("/roomStorage/loadDetail/" + id + "/")
54 | .then((res) => {
55 | this.newForm = res.data;
56 | })
57 | .catch((err) => {
58 | console.log("报错了" + err);
59 | });
60 | },
61 | //保存弹框
62 | submitForm(formName) {
63 | this.$refs[formName].validate((valid) => {
64 | if (valid) {
65 | this.$axios
66 | .post("/roomStorage/save/", this.newForm)
67 | .then((res) => {
68 | if (res.data != null && res.data != "") {
69 | this.$message({
70 | type: "success",
71 | message: "保存成功!",
72 | });
73 | this.dialog.show = false;
74 | this.createParams();
75 | } else {
76 | this.$message.error("保存失败!");
77 | }
78 | })
79 | .catch((err) => {
80 | console.log("报错了" + err);
81 | });
82 | } else {
83 | console.log("error submit!");
84 | return false;
85 | }
86 | });
87 | },
88 | //关闭弹框
89 | addDialogClosed() {
90 | this.$refs.newForm.resetFields();
91 | //初始化数据
92 | this.newForm = {
93 | };
94 | },
95 | // 监听 pagesize 改变的事件
96 | handleSizeChange(newSize) {
97 | // console.log(newSize)
98 | this.queryinfo.pageSize = newSize;
99 | this.createParams();
100 | },
101 | // 监听 页码值 改变的事件
102 | handleCurrentChange(newPage) {
103 | //console.log(newPage)
104 | this.queryinfo.currentPage = newPage;
105 | this.createParams();
106 | },
107 | },
108 | };
--------------------------------------------------------------------------------
/drug-vue/src/js/storage/list.js:
--------------------------------------------------------------------------------
1 | export default {
2 | name: "storageList",
3 | data() {
4 | return {
5 | queryinfo: {
6 | currentPage: 1,
7 | keyword: "",
8 | pageSize: 10,
9 | },
10 | tableData: [],
11 | total: 0,
12 | dialog: {
13 | title: "",
14 | show: false,
15 | },
16 | newForm: {
17 | },
18 | rules: {
19 | validityEndTime: [{ required: true, message: "请输入有效期结束时间", trigger: "blur" }],
20 | },
21 | data: [],
22 | };
23 | },
24 | created() {
25 | this.createParams();
26 | },
27 | methods: {
28 | //初始化数据
29 | createParams() {
30 | //加载列表
31 | this.$axios
32 | .post("/storage/list/page/", this.queryinfo)
33 | .then((res) => {
34 | if (res.data != null && res.data != "") {
35 | this.tableData = res.data.records;
36 | this.total = res.data.total;
37 | } else {
38 | this.$message.error("获取列表失败!");
39 | }
40 | })
41 | .catch((err) => {
42 | console.log("报错了" + err);
43 | });
44 | },
45 |
46 | //展开编辑弹框
47 | edit(id) {
48 | this.dialog = {
49 | title: "编辑有效期结束时间",
50 | show: true,
51 | };
52 | this.$axios
53 | .get("/storage/loadDetail/" + id + "/")
54 | .then((res) => {
55 | this.newForm = res.data;
56 | })
57 | .catch((err) => {
58 | console.log("报错了" + err);
59 | });
60 | },
61 | //保存弹框
62 | submitForm(formName) {
63 | this.$refs[formName].validate((valid) => {
64 | if (valid) {
65 | this.$axios
66 | .post("/storage/save/", this.newForm)
67 | .then((res) => {
68 | if (res.data != null && res.data != "") {
69 | this.$message({
70 | type: "success",
71 | message: "保存成功!",
72 | });
73 | this.dialog.show = false;
74 | this.createParams();
75 | } else {
76 | this.$message.error("保存失败!");
77 | }
78 | })
79 | .catch((err) => {
80 | console.log("报错了" + err);
81 | });
82 | } else {
83 | console.log("error submit!");
84 | return false;
85 | }
86 | });
87 | },
88 | //关闭弹框
89 | addDialogClosed() {
90 | this.$refs.newForm.resetFields();
91 | //初始化数据
92 | this.newForm = {
93 | };
94 | },
95 | // 监听 pagesize 改变的事件
96 | handleSizeChange(newSize) {
97 | // console.log(newSize)
98 | this.queryinfo.pageSize = newSize;
99 | this.createParams();
100 | },
101 | // 监听 页码值 改变的事件
102 | handleCurrentChange(newPage) {
103 | //console.log(newPage)
104 | this.queryinfo.currentPage = newPage;
105 | this.createParams();
106 | },
107 | },
108 | };
--------------------------------------------------------------------------------
/drug-vue/src/js/userLoginLog/list.js:
--------------------------------------------------------------------------------
1 | export default {
2 | name: "userLoginLog",
3 | data() {
4 | return {
5 | queryinfo: {
6 | currentPage: 1,
7 | keyword: "",
8 | pageSize: 10,
9 | },
10 | tableData: [],
11 | total: 0,
12 | data: []
13 | };
14 | },
15 | created() {
16 | this.createParams();
17 | },
18 | methods: {
19 | //初始化数据
20 | createParams() {
21 | //加载列表
22 | this.$axios
23 | .post("/user/loginLog/page/", this.queryinfo)
24 | .then((res) => {
25 | if (res.data != null && res.data != "") {
26 | this.tableData = res.data.records;
27 | this.total = res.data.total;
28 | } else {
29 | this.$message.error("获取列表失败!");
30 | }
31 | })
32 | .catch((err) => {
33 | console.log("报错了" + err);
34 | });
35 | },
36 |
37 |
38 | // 监听 pagesize 改变的事件
39 | handleSizeChange(newSize) {
40 | // console.log(newSize)
41 | this.queryinfo.pageSize = newSize;
42 | this.createParams();
43 | },
44 | // 监听 页码值 改变的事件
45 | handleCurrentChange(newPage) {
46 | //console.log(newPage)
47 | this.queryinfo.currentPage = newPage;
48 | this.createParams();
49 | },
50 | },
51 | };
--------------------------------------------------------------------------------
/drug-vue/src/main.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 | import router from './router'
4 | import store from './store'
5 | import axios from './http'
6 | import has from './views/permission/permission.js'
7 | import ElementUI from 'element-ui'
8 | import VueParticles from 'vue-particles'
9 | import 'element-ui/lib/theme-chalk/index.css'
10 | import './styles/reset.css'
11 | import VCharts from 'v-charts'
12 |
13 | Vue.use(ElementUI);
14 | Vue.use(VueParticles);
15 | Vue.use(VCharts)
16 | Vue.config.productionTip = false;
17 | Vue.prototype.$axios = axios;
18 |
19 | new Vue({
20 | router,
21 | store,
22 | render: h => h(App)
23 | }).$mount('#app')
24 |
25 | axios.defaults.withCredentials = true;
26 |
--------------------------------------------------------------------------------
/drug-vue/src/store/index.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import Vuex from 'vuex'
3 | Vue.use(Vuex)
4 |
5 | const types = {
6 | SET_IS_AUTNENTIATED: 'SET_IS_AUTNENTIATED', // 是否认证通过
7 | SET_USER: 'SET_USER', // 用户信息
8 | }
9 |
10 |
11 | const state = {
12 | isAutnenticated: false, // 是否认证
13 | user: {
14 | permissions: [],
15 | roles: [],
16 | }, // 存储用户信息
17 |
18 |
19 | };
20 | const getters = {
21 | isAutnenticated: state => state.isAutnenticated,
22 | user: state => state.user,
23 | };
24 | const mutations = {
25 | [types.SET_IS_AUTNENTIATED](state, isAutnenticated) {
26 | if (isAutnenticated)
27 | state.isAutnenticated = isAutnenticated
28 | else
29 | state.isAutnenticated = false
30 | },
31 | [types.SET_USER](state, user) {
32 | if (user) {
33 | state.user = user;
34 | state.user.permissions = user.permissions;
35 | state.user.roles = user.roles;
36 | } else {
37 | state.user = {};
38 | }
39 | },
40 | };
41 | const actions = {
42 | setIsAutnenticated: ({ commit }, isAutnenticated) => {
43 | commit(types.SET_IS_AUTNENTIATED, isAutnenticated)
44 | },
45 | setUser: ({ commit }, user) => {
46 | commit(types.SET_USER, user)
47 | },
48 | clearCurrentState: ({ commit }) => {
49 | commit(types.SET_IS_AUTNENTIATED, false)
50 | commit(types.SET_USER, null)
51 | },
52 | };
53 | export default new Vuex.Store({
54 | state,
55 | getters,
56 | mutations,
57 | actions,
58 | })
--------------------------------------------------------------------------------
/drug-vue/src/styles/reset.css:
--------------------------------------------------------------------------------
1 | @charset 'utf-8';
2 |
3 | * {
4 | margin: 0;
5 | padding: 0;
6 | }
7 |
8 | html,
9 | body,
10 | #app,
11 | .wrapper {
12 | width: 100%;
13 | height: 100%;
14 | overflow: hidden;
15 | }
16 |
17 | body {
18 | font-family:Arial,"Microsoft YaHei",Helvetica, sans-serif;
19 | }
20 |
21 | a {
22 | text-decoration: none
23 | }
24 |
25 | ol, ul {
26 | list-style: none;
27 | }
28 | h1,h2,h3,h4,h5,h6{font-weight: normal;}
29 | em,i{font-style: normal;}
30 |
31 | .el-transfer-panel { width: 37%;}
32 | .el-transfer-panel__body{height: 445px;}
33 | .el-transfer-panel__list.is-filterable{height: 85%;}
--------------------------------------------------------------------------------
/drug-vue/src/views/permission/permission.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 |
3 | /**权限指令**/
4 | const has = Vue.directive('has', {
5 | inserted: function (el, binding, vnode) {
6 | //console.log(binding)
7 | // 获取页面按钮权限
8 | if (!Vue.prototype.$_has(binding.arg)) {
9 | el.parentNode.removeChild(el);
10 | }
11 | }
12 | });
13 |
14 |
15 | // 权限检查方法
16 | Vue.prototype.$_has = function (value) {
17 | let allow = false;
18 | // 获取用户按钮权限
19 | let authUser = JSON.parse(localStorage.getItem("auth-user"))
20 | //获取角色
21 | let roles = authUser.roles;
22 | //无角色不允许访问
23 | if (roles.length == 0) {
24 | return false;
25 | }
26 | //包含管理员角色不限制
27 | let isAdmin = authUser.roles.some(function (item, index) {
28 | return item.name === "admin";
29 | });
30 |
31 | if (isAdmin) {
32 | return true;
33 | }
34 |
35 |
36 | for (let i = 0; i < roles.length; i++) {
37 | let eachRole = roles[i];
38 | if(eachRole.permissionNames == null){
39 | return false;
40 | } else {
41 | allow = eachRole.permissionNames.some(function (item, index) {
42 | return item === value;
43 | });
44 |
45 | if (allow) {
46 | return true;
47 | }
48 | }
49 | }
50 | return allow;
51 | };
52 | export { has }
--------------------------------------------------------------------------------
/drug-vue/vue.config.js:
--------------------------------------------------------------------------------
1 | // vue.config.js
2 | const path = require('path');
3 | const IS_PROD = ['production', 'prod'].includes(process.env.NODE_ENV);
4 | const resolve = (dir) => path.join(__dirname, dir);
5 | module.exports = {
6 | publicPath: process.env.NODE_ENV === 'production' ? '/site/vue-demo/' : '/', // 公共路径
7 | indexPath: 'index.html', // 相对于打包路径index.html的路径
8 | outputDir: process.env.outputDir || 'dist', // 'dist', 生产环境构建文件的目录
9 | assetsDir: 'static', // 相对于outputDir的静态资源(js、css、img、fonts)目录
10 | lintOnSave: false, // 是否在开发环境下通过 eslint-loader 在每次保存时 lint 代码
11 | runtimeCompiler: true, // 是否使用包含运行时编译器的 Vue 构建版本
12 | productionSourceMap: !IS_PROD, // 生产环境的 source map
13 | parallel: require("os").cpus().length > 1, // 是否为 Babel 或 TypeScript 使用 thread-loader。该选项在系统的 CPU 有多于一个内核时自动启用,仅作用于生产构建。
14 | pwa: {}, // 向 PWA 插件传递选项。
15 | chainWebpack: config => {
16 | config.resolve.symlinks(true); // 修复热更新失效
17 | // 如果使用多页面打包,使用vue inspect --plugins查看html是否在结果数组中
18 | config.plugin("html").tap(args => {
19 | // 修复 Lazy loading routes Error
20 | args[0].chunksSortMode = "none";
21 | return args;
22 | });
23 | },
24 | devServer: {
25 | overlay: { // 让浏览器 overlay 同时显示警告和错误
26 | warnings: true,
27 | errors: true
28 | },
29 | host: "localhost",
30 | port: 8889, // 端口号
31 | https: false, // https:{type:Boolean}
32 | open: false, //配置自动启动浏览器
33 | hotOnly: true, // 热更新
34 | proxy: "http://localhost:8888"
35 | }
36 | }
37 |
38 |
39 |
--------------------------------------------------------------------------------
/drug/.gitignore:
--------------------------------------------------------------------------------
1 | /out/
2 | !.mvn/wrapper/maven-wrapper.jar
3 | *.zip
4 | *.docs
5 | /drug/target/
6 | /drug-vue/node_modules/
7 | ### STS ###
8 | .apt_generated
9 | .classpath
10 | .factorypath
11 | .project
12 | .settings
13 | .springBeans
14 | .sts4-cache
15 |
16 | ### IntelliJ IDEA ###
17 | .idea
18 | *.iws
19 | *.iml
20 | *.ipr
21 | .mvn
22 | mvnw
23 | mvnw.cmd
24 |
25 | ### NetBeans ###
26 | /nbproject/private/
27 | /build/
28 | /nbbuild/
29 | /dist/
30 | /nbdist/
31 | /.nb-gradle/
32 |
--------------------------------------------------------------------------------
/drug/src/main/java/com/drug/Application.java:
--------------------------------------------------------------------------------
1 | package com.drug;
2 |
3 | import com.alibaba.nacos.spring.context.annotation.config.NacosPropertySource;
4 | import org.mybatis.spring.annotation.MapperScan;
5 | import org.springframework.boot.SpringApplication;
6 | import org.springframework.boot.autoconfigure.SpringBootApplication;
7 | import org.springframework.boot.builder.SpringApplicationBuilder;
8 | import org.springframework.boot.web.servlet.ServletComponentScan;
9 | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
10 | import org.springframework.context.annotation.Configuration;
11 | import org.springframework.transaction.annotation.EnableTransactionManagement;
12 |
13 | @Configuration
14 | @EnableTransactionManagement
15 | @MapperScan("com.drug.dao")
16 | @SpringBootApplication(scanBasePackages = "com.drug")
17 | @ServletComponentScan
18 | @NacosPropertySource(dataId = "example", autoRefreshed = true)
19 | public class Application extends SpringBootServletInitializer {
20 |
21 | /**
22 | * 如果要发布到自己的Tomcat中的时候,需要继承SpringBootServletInitializer类,并且增加如下的configure方法。
23 | * 如果不发布到自己的Tomcat中的时候,就无需上述的步骤
24 | */
25 | protected SpringApplicationBuilder configure(
26 | SpringApplicationBuilder application) {
27 | return application.sources(Application.class);
28 | }
29 |
30 | public static void main(String[] args) throws Exception {
31 | SpringApplication.run(Application.class, args);
32 | }
33 | }
--------------------------------------------------------------------------------
/drug/src/main/java/com/drug/api/APIResult.java:
--------------------------------------------------------------------------------
1 | package com.drug.api;
2 |
3 | import io.swagger.annotations.ApiModel;
4 | import io.swagger.annotations.ApiModelProperty;
5 |
6 | /**
7 | * 接口返回
8 | *
9 | * @param
10 | */
11 | @ApiModel(description="API返回公共组件")
12 | public class APIResult extends ResultSupport {
13 |
14 | private static final long serialVersionUID = -1444725629728008153L;
15 |
16 | @ApiModelProperty(value="返回数据对象")
17 | protected T data;
18 |
19 | public T getData() {
20 | return data;
21 | }
22 |
23 | public void setData(T data) {
24 | this.data = data;
25 | }
26 |
27 | /**
28 | * 接口调用失败,有错误字符串码和描述,有返回对象
29 | * @param code
30 | * @param message
31 | * @param data
32 | * @param
33 | * @return
34 | */
35 | public static APIResult newFailResult(int code, String message, U data) {
36 | APIResult apiResult = new APIResult();
37 | apiResult.setCode(code);
38 | apiResult.setMessage(message);
39 | apiResult.setData(data);
40 | return apiResult;
41 | }
42 |
43 | /**
44 | * 接口调用失败,有错误字符串码和描述,没有返回对象
45 | * @param code
46 | * @param message
47 | * @param
48 | * @return
49 | */
50 | public static APIResult newFailResult(int code, String message) {
51 | APIResult apiResult = new APIResult();
52 | apiResult.setCode(code);
53 | apiResult.setMessage(message);
54 | return apiResult;
55 | }
56 |
57 | /**
58 | * 接口调用失败,有默认字符串码和描述,没有返回对象
59 | * @param message
60 | * @param
61 | * @return
62 | */
63 | public static APIResult newFailResult(String message) {
64 | return newFailResult(ResultCode.ERROR_CODE, message);
65 | }
66 |
67 | /**
68 | * 接口调用失败,有默认字符串码,没有描述,没有返回对象
69 | * @param
70 | * @return
71 | */
72 | public static APIResult newFailResult() {
73 | return newFailResult(null);
74 | }
75 |
76 | /**
77 | * 接口调用成功返回数据 包含对象属性及CODE
78 | * @param data
79 | * @return
80 | */
81 | public static APIResult newSuccessResult(int code, U data){
82 | APIResult apiResult = new APIResult();
83 | apiResult.setCode(code);
84 | apiResult.setData(data);
85 | return apiResult;
86 | }
87 |
88 | /**
89 | * 接口调用成功返回数据 包含对象属性
90 | * @param data
91 | * @return
92 | */
93 | public static APIResult newSuccessResult(U data){
94 | return newSuccessResult(ResultCode.SUCCESS_CODE, data);
95 | }
96 |
97 | /**
98 | * 接口调用成功返回数据 不包含对象属性
99 | * @return
100 | * @return
101 | */
102 | public static APIResult