1
0
ソースを参照

Merge branch 'dev1.0' of http://123.207.73.252:3000/lzf/hospital into dev1.0

Ciallo 10 ヶ月 前
コミット
7b0c898342
41 ファイル変更482 行追加192 行削除
  1. 1 1
      admin-ui/src/views/index.vue
  2. 2 2
      admin-ui/src/views/system/dept/edit.vue
  3. 1 1
      admin-ui/src/views/system/dept/index.vue
  4. 9 6
      admin-ui/src/views/system/role/index.vue
  5. 0 81
      admin-ui/src/views/work/user/edit.vue
  6. 1 15
      admin-ui/src/views/work/user/index.vue
  7. 2 1
      app/App.vue
  8. 68 2
      app/common/common.scss
  9. 23 1
      app/pages.json
  10. 37 0
      app/pages/department/detail.vue
  11. 13 17
      app/pages/department/index.vue
  12. 75 0
      app/pages/department/search.vue
  13. 3 3
      app/pages/detection/index.vue
  14. 1 1
      app/pages/doctor/detail.vue
  15. 18 6
      app/pages/doctor/index.vue
  16. 75 0
      app/pages/doctor/search.vue
  17. 14 11
      app/pages/index/index.vue
  18. 30 5
      app/pages/user/bind/add.vue
  19. 1 0
      app/pages/user/bind/index.vue
  20. 9 3
      app/pages/user/index.vue
  21. 18 6
      app/pages/user/login.vue
  22. 2 0
      app/pages/visit/detail.vue
  23. 5 3
      app/pages/visit/doctor/detail.vue
  24. 2 2
      app/pages/visit/index.vue
  25. 8 1
      app/uni_modules/uview-ui/components/u-action-sheet/u-action-sheet.vue
  26. 6 2
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java
  27. 7 0
      ruoyi-admin/src/main/java/com/ruoyi/web/work/api/Api_DepartmentController.java
  28. 3 2
      ruoyi-admin/src/main/java/com/ruoyi/web/work/api/Api_DoctorController.java
  29. 3 0
      ruoyi-admin/src/main/java/com/ruoyi/web/work/domain/BindUser.java
  30. 3 0
      ruoyi-admin/src/main/java/com/ruoyi/web/work/domain/User.java
  31. 3 0
      ruoyi-admin/src/main/java/com/ruoyi/web/work/domain/dto/BindDto.java
  32. 5 1
      ruoyi-admin/src/main/java/com/ruoyi/web/work/service/impl/BindUserServiceImpl.java
  33. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/web/work/service/impl/FollowRecordServiceImpl.java
  34. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/web/work/service/impl/FollowTemplateServiceImpl.java
  35. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/web/work/service/impl/KnowledgeServiceImpl.java
  36. 13 11
      ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysPermissionService.java
  37. 1 2
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java
  38. 1 1
      ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserService.java
  39. 6 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java
  40. 2 2
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java
  41. 8 0
      ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml

+ 1 - 1
admin-ui/src/views/index.vue

@@ -4,7 +4,7 @@
       <span style="font-size: 19px">欢迎使用岑溪人民医院随访系统</span>
       <iframe allowtransparency="true" frameborder="0" width="180" height="36" scrolling="no" style="padding-top: 10px" src="//tianqi.2345.com/plugin/widget/index.htm?s=3&z=2&t=0&v=0&d=2&bd=0&k=&f=#545555&ltf=#545555&htf=ffffff&q=1&e=1&a=1&c=72036&w=180&h=36&align=center"></iframe>
     </div>
-    <div class="chart-wrapper" v-if="user.roleName == '医生'">
+    <div class="chart-wrapper" v-if="user.roleName == '医生'||user.roleName == '科室主任'">
       <!--个人形象-->
       <div class="pop" style="width: 65%">
         <div class="out">

+ 2 - 2
admin-ui/src/views/system/dept/edit.vue

@@ -5,7 +5,7 @@
         <treeselect v-model="form.parentId" :options="deptOptions" :normalizer="normalizer" placeholder="选择上级科室" />
       </el-form-item>
       <el-form-item label="科室名称" prop="deptName"><el-input v-model="form.deptName" placeholder="请输入科室名称" /></el-form-item>
-      <div v-if="form.parentId != 0">
+      <div v-if="form.parentId != 0 && form.ancestors.length == 3">
         <el-form-item label="科室介绍" prop="brief">
           <editor v-model="form.brief" placeholder="请输入"></editor>
         </el-form-item>
@@ -44,7 +44,6 @@ export default {
       rules: {
         parentId: [{ required: true, message: '上级部门不能为空', trigger: 'blur' }],
         deptName: [{ required: true, message: '部门名称不能为空', trigger: 'blur' }],
-        brief: [{ required: true, message: '科室介绍不能为空', trigger: 'blur' }],
         orderNum: [{ required: true, message: '显示排序不能为空', trigger: 'blur' }]
       }
     };
@@ -53,6 +52,7 @@ export default {
     if (this.param.id) {
       getDept(this.param.id).then((response) => {
         this.form = response.data;
+        this.form.brief=this.form.brief||'';
         this.form.ancestors = this.form.ancestors.split(',') || [];
         listDeptExcludeChild(this.param.id).then((response) => {
           this.deptOptions = this.handleTree(response.data, 'deptId');

+ 1 - 1
admin-ui/src/views/system/dept/index.vue

@@ -26,7 +26,7 @@
       <el-table-column label="操作" align="center" width="220">
         <template slot-scope="scope">
           <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:dept:edit']">修改</el-button>
-          <el-button size="mini" type="text" icon="el-icon-plus" @click="handleAdd(scope.row)" v-hasPermi="['system:dept:add']" v-if="scope.row.parentId==0">新增</el-button>
+          <el-button size="mini" type="text" icon="el-icon-plus" @click="handleAdd(scope.row)" v-hasPermi="['system:dept:add']" v-if="scope.row.ancestors.length < 3">新增</el-button>
           <el-button v-if="scope.row.parentId != 0" size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['system:dept:remove']">删除</el-button>
         </template>
       </el-table-column>

+ 9 - 6
admin-ui/src/views/system/role/index.vue

@@ -25,19 +25,20 @@
     </el-row>
     <el-table :data="roleList" border @selection-change="handleSelectionChange" height="calc(100vh - 273px)">
       <el-table-column type="selection" width="55" align="center" />
-      <el-table-column label="角色名称" prop="roleName" align="center" :show-overflow-tooltip="true" />
+      <el-table-column label="角色名称" prop="roleName" align="center" width="220"/>
+      <el-table-column label="角色备注" prop="remark" align="center"/>
       <el-table-column label="权限字符" prop="roleKey" align="center" :show-overflow-tooltip="true" width="150" />
-      <el-table-column label="状态" align="center" width="100">
+      <el-table-column label="状态" align="center" width="120">
         <template slot-scope="scope">
           <el-switch v-model="scope.row.status" active-value="0" inactive-value="1" @change="handleStatusChange(scope.row)"></el-switch>
         </template>
       </el-table-column>
-      <el-table-column label="创建时间" align="center" prop="createTime" width="180">
+      <el-table-column label="创建时间" align="center" prop="createTime" width="200">
         <template slot-scope="scope">
           <span>{{ parseTime(scope.row.createTime) }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="操作" align="center" width="200">
+      <el-table-column label="操作" align="center" width="220">
         <template slot-scope="scope" v-if="scope.row.roleId !== 1">
           <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:role:edit']">修改</el-button>
           <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['system:role:remove']">删除</el-button>
@@ -79,7 +80,7 @@
           <el-checkbox v-model="menuNodeAll" @change="handleCheckedTreeNodeAll($event, 'menu')">全选/全不选</el-checkbox>
           <el-tree class="tree-border" :data="menuOptions" show-checkbox ref="menu" node-key="id" :check-strictly="!form.menuCheckStrictly" empty-text="加载中,请稍候" :props="defaultProps"></el-tree>
         </el-form-item>
-        <el-form-item label="备注"><el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input></el-form-item>
+        <el-form-item label="备注"><el-input v-model="form.remark" type="textarea" placeholder="请输入内容" rows="3"></el-input></el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="submitForm">确 定</el-button>
@@ -176,7 +177,9 @@ export default {
         pageSize: 10,
         roleName: undefined,
         roleKey: undefined,
-        status: undefined
+        status: undefined,
+        orderByColumn: 'r.create_time', //排序字段
+        isAsc: 'desc' //排序方式
       },
       // 表单参数
       form: {},

+ 0 - 81
admin-ui/src/views/work/user/edit.vue

@@ -1,81 +0,0 @@
-<template>
-  <div class="cmain">
-      <el-form ref="form" :model="form" :rules="rules" label-width="100px">
-        <el-form-item label="微信id" prop="openId">
-          <el-input v-model="form.openId" placeholder="请输入微信id" clearable/>
-        </el-form-item>
-        <el-form-item label="状态" prop="state">
-          <el-input v-model="form.state" placeholder="请输入状态" clearable/>
-        </el-form-item>
-        <el-form-item label="创建者" prop="createBy">
-          <el-input v-model="form.createBy" placeholder="请输入创建者" clearable/>
-        </el-form-item>
-        <el-form-item label="创建时间" prop="createTime">
-          <el-date-picker clearable
-            v-model="form.createTime"
-            type="date"
-            value-format="yyyy-MM-dd"
-            placeholder="请选择创建时间">
-          </el-date-picker>
-        </el-form-item>
-        <el-form-item label="更新者" prop="updateBy">
-          <el-input v-model="form.updateBy" placeholder="请输入更新者" clearable/>
-        </el-form-item>
-        <el-form-item label="更新时间" prop="updateTime">
-          <el-date-picker clearable
-            v-model="form.updateTime"
-            type="date"
-            value-format="yyyy-MM-dd"
-            placeholder="请选择更新时间">
-          </el-date-picker>
-        </el-form-item>
-      </el-form>
-    <div class="mfooter">
-      <el-button type="primary" @click="submitForm">确 定</el-button>
-      <el-button @click="$layer.close(layerid)">取 消</el-button>
-    </div>
-  </div>
-</template>
-
-<script>
-export default {
-  data() {
-    return {
-      form: {},
-      rules: {
-        openId: [
-          { required: true, message: "微信id不能为空", trigger: "blur" }
-        ],
-      }
-    };
-  },
-  mounted() {
-    if (this.param.id) {
-      this.ajax({ url: '/work/user/detail/' + this.param.id }).then(response => {
-        this.form = response.data;
-      });
-    }
-  },
-  methods: {
-    submitForm() {
-      this.$refs["form"].validate(valid => {
-        if (valid) {
-          if (this.form.id) {
-              this.ajax({method: 'post',url: '/work/user/edit', data: this.form }).then(response => {
-                  this.$modal.msgSuccess("修改成功");
-                  this.$layer.close(this.layerid);
-                  this.$parent.getList();
-              });
-          } else {
-              this.ajax({method: 'post',url: '/work/user/add', data: this.form }).then(response => {
-                  this.$modal.msgSuccess("新增成功");
-                  this.$layer.close(this.layerid);
-                  this.$parent.getList();
-               });
-          }
-        }
-      });
-    }
-  }
-};
-</script>

+ 1 - 15
admin-ui/src/views/work/user/index.vue

@@ -12,13 +12,7 @@
         <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
       </el-form-item>
     </el-form>
-    <el-row :gutter="10" class="mb8">
-      <el-button type="primary" icon="el-icon-plus" :disabled="ids.length > 0" @click="op('add')" v-hasPermi="['work:user:add']">新增</el-button>
-      <el-button type="success" icon="el-icon-edit" :disabled="ids.length != 1" @click="op('edit', ids)" v-hasPermi="['work:user:edit']">修改</el-button>
-      <el-button type="danger" icon="el-icon-delete" :disabled="ids.length == 0" @click="del" v-hasPermi="['work:user:remove']">删除{{ ids.length > 0 ? '(' + ids.length + ')' : '' }}</el-button>
-    </el-row>
-
-    <el-table :data="response.rows" border @selection-change="selects" height="calc(100vh - 270px)">
+    <el-table :data="response.rows" border @selection-change="selects" height="calc(100vh - 230px)">
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="微信openId" align="left" prop="openId" />
       <el-table-column label="绑定就诊人" align="center" width="160">
@@ -52,7 +46,6 @@
 </template>
 
 <script>
-import edit from './edit';
 export default {
   name: 'User',
   data() {
@@ -88,13 +81,6 @@ export default {
       this.ids = rows.map((item) => item.id);
     },
     op(tag, row) {
-      if (tag == 'add') {
-        this.iframe({ obj: edit, param: {}, title: '新增', width: '45%', height: '55%' });
-      }
-      if (tag == 'edit') {
-        const id = row.id || this.ids[0];
-        this.iframe({ obj: edit, param: { id: id }, title: '编辑', width: '50%', height: '50%' });
-      }
       //账号状态
       if (tag == 'change') {
         let text = row.state === 0 ? '启用' : '禁用';

+ 2 - 1
app/App.vue

@@ -17,6 +17,7 @@ page {
 	background-color: #f1f1f1;
 }	
 /*公共css */
+@import '@/common/animate.min.css';
 @import '@/common/common.scss';
 @import '@/uni_modules/uview-ui/index.scss';
 /**uniapp中uni.showModal H5中被挡住的解决方案*/
@@ -30,7 +31,7 @@ button::after {
 /**挂载iconfont字体图标*/
 @font-face {
 	font-family: 'iconfont';
-	src: url('https://at.alicdn.com/t/c/font_4620946_wjo0wa9j5yc.ttf?t=1724155918797') format('truetype');
+	src: url('https://at.alicdn.com/t/c/font_4620946_c5ea6r77n3b.ttf?t=1724749291287') format('truetype');
 	/* src: url('~@/static/font/iconfont.ttf') format('truetype'); */
 }
 .icon {

+ 68 - 2
app/common/common.scss

@@ -60,6 +60,9 @@
 	padding: 5px 15px 5px 15px;
 }
 .msilde {
+	.search {
+		padding: 7px 15px 10px 15px;
+	}
 	.top {
 		padding: 10px;
 		text-align: center;
@@ -112,6 +115,17 @@
 					border-radius: 5px;
 					float: left;
 				}
+				.title {
+					color: $font-c;
+					font-size: 14px;
+					width: 85%;
+				}
+				.icon {
+					float: right;
+					color: $font-c;
+					margin-top: -18px;
+					font-size: 15px;
+				}
 				.con {
 					float: left;
 					width: 60%;
@@ -179,7 +193,6 @@
 }
 .xy {
 	color: $font-c;
-	padding-top: 15px;
 	font-size: 14px;
 	.checkbox {
 		float: left;
@@ -465,4 +478,57 @@
 			}
 		}
 	}
-}
+}
+.history {
+	overflow: hidden;
+	padding-top: 10px;
+	padding-bottom: 10px;
+	.title {
+		margin-bottom: 12px;
+		font-weight: bold;
+	}
+	.del {
+		float: right;
+		font-size: 14px;
+		margin-top: -30px;
+		color: #f44336;
+		.icon {
+			padding-right: 3px;
+		}
+	}
+	.tag {
+		float: left;
+		padding: 4px 10px;
+		border-radius: 30px;
+		background-color: #eeeeee;
+		margin-right: 10px;
+		margin-bottom: 5px;
+		font-size: 14px;
+		color: $font-c;
+	}
+}
+.search_list {
+	padding: 0px 10px 0px 10px;
+	background-color: white;
+	border-radius: 10px;
+	margin-top: 15px;
+	.item {
+		padding: 15px 5px 15px 0px;
+		overflow: hidden;
+		border-bottom: 1px solid $line;
+		&:last-child {
+			border: 0px;
+		}
+		.title {
+			color: $font-c;
+			font-size: 14px;
+			width: 85%;
+		}
+		.icon {
+			float: right;
+			color: $font-c;
+			margin-top: -18px;
+			font-size: 15px;
+		}
+	}
+}

+ 23 - 1
app/pages.json

@@ -50,7 +50,8 @@
 		{
 			"path": "pages/user/login",
 			"style": {
-				"navigationBarTitleText": "用户登录"
+				"navigationBarTitleText": "用户登录",
+				"navigationStyle": "custom"
 			}
 		},
 		{
@@ -249,6 +250,27 @@
 			{
 				"navigationBarTitleText" : "检测报告详情"
 			}
+		},
+		{
+			"path" : "pages/department/detail",
+			"style" : 
+			{
+				"navigationBarTitleText" : "科室详情"
+			}
+		},
+		{
+			"path" : "pages/department/search",
+			"style" : 
+			{
+				"navigationBarTitleText" : "搜索科室"
+			}
+		},
+		{
+			"path" : "pages/doctor/search",
+			"style" : 
+			{
+				"navigationBarTitleText" : "搜索医生"
+			}
 		}
 	],
 	"tabBar": {

+ 37 - 0
app/pages/department/detail.vue

@@ -0,0 +1,37 @@
+<template>
+	<view class="detail">
+		<view class="con">
+			<u-parse :content="item.brief" v-if="item.brief"></u-parse>
+			<u-empty v-else text="整理资料中..."></u-empty>
+		</view>
+	</view>
+</template>
+
+<script>
+export default {
+	data() {
+		return {
+			item: {}
+		};
+	},
+	onLoad(e) {
+		this.http.request({
+			url: '/app/department/detail/' + e.id,
+			success: (res) => {
+				this.item = res.data.data;
+				uni.setNavigationBarTitle({ title: this.item.deptName });
+				if (res.data.data.brief) {
+					this.item.brief = res.data.data.brief.replace(new RegExp('/profile/upload/', 'g'), this.http.ip + '/profile/upload/');
+				}
+			}
+		});
+	},
+	methods: {}
+};
+</script>
+
+<style lang="scss">
+page {
+	background-color: white;
+}
+</style>

+ 13 - 17
app/pages/department/index.vue

@@ -1,13 +1,19 @@
 <template>
 	<view class="msilde">
+		<view class="search">
+			<u-search placeholder="搜索科室" :disabled="true" bgColor="white" :showAction="false" @click="go('/pages/department/search')"></u-search>
+		</view>
 		<view class="left">
-			<view :class="{ active: index == current }" v-for="(item, index) in list" :key="index" class="item" @click="selected(item, index)">{{ item.deptName }}</view>
+			<view :class="{ active: index == current }" v-for="(item, index) in list" :key="index" class="item" @click="current = index">{{ item.deptName }}</view>
 		</view>
 		<view class="right">
-			<view class="contents">
-				<u-parse :content="item.brief" v-if="item.brief"></u-parse>
-				<u-empty v-else text="整理资料中..."></u-empty>
+			<view class="list" v-if="list.length > 0">
+				<view class="item" v-for="(item, index) in list[current].children" :key="item.deptId" @click="go('/pages/department/detail?id=' + item.deptId)">
+					<view class="title omit">{{ item.deptName }}</view>
+					<view class="icon">&#xe62b;</view>
+				</view>
 			</view>
+			<u-empty v-else text="整理资料中..."></u-empty>
 		</view>
 	</view>
 </template>
@@ -16,8 +22,8 @@
 export default {
 	data() {
 		return {
+			title: '',
 			current: 0,
-			item: {},
 			list: []
 		};
 	},
@@ -30,21 +36,11 @@ export default {
 				url: '/app/department/list',
 				success: (res) => {
 					this.list = res.data.data;
-					this.selected(this.list[0], 0);
 				}
 			});
 		},
-		selected(item, index) {
-			this.current = index;
-			this.http.request({
-				url: '/app/department/detail/' + item.deptId,
-				success: (res) => {
-					this.item = res.data.data;
-					if (res.data.data.brief) {
-						this.item.brief = res.data.data.brief.replace(new RegExp('/profile/upload/', 'g'), this.http.ip + '/profile/upload/');
-					}
-				}
-			});
+		go(url) {
+			uni.navigateTo({ url: url });
 		}
 	}
 };

+ 75 - 0
app/pages/department/search.vue

@@ -0,0 +1,75 @@
+<template>
+	<view class="main">
+		<view class="search">
+			<u-search placeholder="搜索科室" :focus="true" bgColor="white" v-model="deptName" :showAction="false" @search="search()" @clear="refresh()"></u-search>
+		</view>
+		<view class="search_list">
+			<view class="history" v-if="!focus">
+				<view class="title">搜索历史</view>
+				<view class="del" v-if="history.length > 0" @click="del()">
+					<text class="icon">&#xe8b6;</text>
+					<text>清除</text>
+				</view>
+				<view class="tag" v-for="(item, index) in history" :key="item" @click="(deptName = item), search()">{{ item }}</view>
+			</view>
+			<view class="item" v-for="(item, index) in list" :key="item.deptId" @click="go('/pages/department/detail?id=' + item.deptId)">
+				<view class="title omit">{{ item.deptName }}</view>
+				<view class="icon">&#xe62b;</view>
+			</view>
+			<u-empty v-if="list.length == 0"></u-empty>
+		</view>
+	</view>
+</template>
+<script>
+export default {
+	data() {
+		return {
+			list: [],
+			focus: false,
+			history: uni.getStorageSync('history') || [],
+			deptName: ''
+		};
+	},
+	onLoad(e) {},
+	methods: {
+		getData() {
+			this.http.request({
+				url: '/app/department/selectDeptList',
+				data: { deptName: this.deptName },
+				success: (res) => {
+					this.list = res.data.data;
+				}
+			});
+		},
+		go(url) {
+			uni.navigateTo({ url: url });
+		},
+		search() {
+			if (this.deptName.trim()) {
+				this.focus = true;
+				if (this.history.filter((item) => item == this.deptName.trim()) == 0) {
+					this.history.unshift(this.deptName);
+					uni.setStorageSync('history', this.history);
+				}
+				this.getData();
+			}
+		},
+		refresh() {
+			this.deptName = '';
+			this.list = [];
+			this.search();
+		},
+		del() {
+			uni.removeStorageSync('history');
+			this.history = [];
+		},
+		clear() {
+			this.focus = false;
+			this.deptName = '';
+			this.list = [];
+		}
+	}
+};
+</script>
+
+<style lang="scss"></style>

+ 3 - 3
app/pages/detection/index.vue

@@ -2,11 +2,11 @@
 	<view class="main">
 		<view class="top">
 			<view class="nameBox">
-				<view class="name">{{ user.patientName ? user.patientName : '还未绑定就诊人' }}</view>
+				<view class="name">{{ param.patientName ? param.patientName : '还未绑定就诊人' }}</view>
 				<text class="icon arrow" style="margin-left: 10px;">&#xeb73;</text>
 				<view class="change" @click="showChange = true">切换就诊人</view>
 			</view>
-			<view class="cardNum">{{param.patientName ? user.patientId : '还未绑定就诊人'}}</view>
+			<view class="cardNum">{{param.patientName ? param.patientId : '还未绑定就诊人'}}</view>
 			<view style="display: flex;text-align: center;margin: 5px;padding: 13px;font-size: 13px;"
 				@click="calendar = true">
 				<input placeholder="点击选择时间" :disabled="true" v-model="startTime" type="select" />
@@ -35,7 +35,7 @@
 		<u-popup :show="showChange" @close="closePopup" @open="openPopup" :round="10" :closeable="true">
 			<view>
 				<view class="userChangeTitle">请选择就诊人</view>
-				<scroll-view scroll-y="true" class="scroll-Y" style="height: 300px;">
+				<scroll-view scroll-y="true" class="scroll-Y" style="max-height: 300px;">
 					<u-radio-group v-model="param.patientId" iconPlacement="left" placement="column">
 						<u-radio v-for="(item,index) in userList" :name="item.patientId" @change="groupChange(item)"
 							:customStyle="{ backgroundColor: '#F8F8F8', margin:'5px 20px',borderRadius: '10px',padding: '10px'}">

+ 1 - 1
app/pages/doctor/detail.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="detail">
 		<view class="top">
-			<image :src="ip + item.avatar" mode="widthFix" class="avatar" v-if="item.avatar"></image>
+			<image :src="item.avatar ? ip + item.avatar : '../../static/head.png'" mode="widthFix" class="avatar"></image>
 			<view class="title">{{ item.name }}</view>
 		</view>
 		<view class="con">

+ 18 - 6
app/pages/doctor/index.vue

@@ -1,7 +1,14 @@
 <template>
 	<view class="msilde">
+		<view class="search">
+			<u-search placeholder="搜索医生" :disabled="true" bgColor="white" :showAction="false" @click="go('/pages/doctor/search')"></u-search>
+		</view>
 		<view class="left">
-			<view :class="{ active: index == current }" v-for="(item, index) in list" :key="index" class="item" @click="selected(item, index)">{{ item.deptName }}</view>
+			<u-collapse accordion :value="list[0].deptId">
+				<u-collapse-item :title="d.deptName" :name="d.deptId" v-for="(d, index) in list" :key="d.deptName">
+					<view :class="{ active: index == i.current }" v-for="(i, index) in d.children" :key="i.deptName" class="item" @click="selected(i, index)">{{ i.deptName }}</view>
+				</u-collapse-item>
+			</u-collapse>
 		</view>
 		<view class="right">
 			<view class="list" v-if="doctor_list.length > 0">
@@ -9,7 +16,7 @@
 					<image :src="item.avatar ? ip + item.avatar : '../../static/head.png'" mode="scaleToFill" class="avatar"></image>
 					<view class="con">
 						<view class="name">{{ item.name }}</view>
-						<view class="brief ellip">{{ item.brief || '暂无介绍资料' }}</view>
+						<view class="brief ellip">{{ item.brief||'暂无介绍' }}</view>
 					</view>
 				</view>
 			</view>
@@ -22,10 +29,9 @@
 export default {
 	data() {
 		return {
-			current: 0,
 			ip: this.http.ip,
 			doctor_list: {},
-			list: []
+			list: [{ deptId: 0 }]
 		};
 	},
 	onLoad(e) {
@@ -37,12 +43,18 @@ export default {
 				url: '/app/department/list',
 				success: (res) => {
 					this.list = res.data.data;
-					this.selected(this.list[0], 0);
+					if (this.list.length > 0 && this.list[0].children.length > 0) {
+						this.selected(this.list[0].children[0], 0);
+					}
 				}
 			});
 		},
+		open() {
+			this.current = -1;
+		},
 		selected(item, index) {
-			this.current = index;
+			this.list.flatMap((i) => i.children).forEach((j) => (j.current = -1));
+			item.current = index;
 			this.http.request({
 				url: '/app/doctor/list',
 				data: { deptId: item.deptId },

+ 75 - 0
app/pages/doctor/search.vue

@@ -0,0 +1,75 @@
+<template>
+	<view class="main">
+		<view class="search">
+			<u-search placeholder="搜索医生" :focus="true" bgColor="white" v-model="nickName" :showAction="false" @search="search()" @clear="refresh()"></u-search>
+		</view>
+		<view class="search_list">
+			<view class="history" v-if="!focus">
+				<view class="title">搜索历史</view>
+				<view class="del" v-if="history.length > 0" @click="del()">
+					<text class="icon">&#xe8b6;</text>
+					<text>清除</text>
+				</view>
+				<view class="tag" v-for="(item, index) in history" :key="item" @click="(nickName = item), search()">{{ item }}</view>
+			</view>
+			<view class="item" v-for="(item, index) in list" :key="item.deptId" @click="go('/pages/doctor/detail?id=' + item.id)">
+				<view class="title omit">{{ item.name }}</view>
+				<view class="icon">&#xe62b;</view>
+			</view>
+			<u-empty v-if="list.length == 0"></u-empty>
+		</view>
+	</view>
+</template>
+<script>
+export default {
+	data() {
+		return {
+			list: [],
+			focus: false,
+			history: uni.getStorageSync('history2') || [],
+			nickName: ''
+		};
+	},
+	onLoad(e) {},
+	methods: {
+		getData() {
+			this.http.request({
+				url: '/app/doctor/list',
+				data: { nickName: this.nickName },
+				success: (res) => {
+					this.list = res.data.data;
+				}
+			});
+		},
+		go(url) {
+			uni.navigateTo({ url: url });
+		},
+		search() {
+			if (this.nickName.trim()) {
+				this.focus = true;
+				if (this.history.filter((item) => item == this.nickName.trim()) == 0) {
+					this.history.unshift(this.nickName);
+					uni.setStorageSync('history2', this.history);
+				}
+				this.getData();
+			}
+		},
+		refresh() {
+			this.nickName = '';
+			this.list = [];
+			this.search();
+		},
+		del() {
+			uni.removeStorageSync('history2');
+			this.history = [];
+		},
+		clear() {
+			this.focus = false;
+			this.nickName = '';
+			this.list = [];
+		}
+	}
+};
+</script>
+
+<style lang="scss"></style>

+ 14 - 11
app/pages/index/index.vue

@@ -9,9 +9,9 @@
 		<view class="flow">
 			<view class="item" @click="go('/pages/doctor/index')">
 				<view class="out">
-					<view class="int" style="height: 200px; background-color: #e8f3fe">
+					<view class="int" style="height: 170px; background-color: #e8f3fe">
 						<image src="https://chenglantimes.com/prod-api/profile/upload/2024/08/23/1724382299288.jpg" mode="widthFix"></image>
-						<view class="title">
+						<view class="title" style="color: #8fb5d7;">
 							<view>医生团队</view>
 							<view class="desc">权威团队会诊</view>
 						</view>
@@ -20,21 +20,21 @@
 			</view>
 			<view class="item">
 				<view class="out" @click="go('/pages/department/index')">
-					<view class="int" style="height: 80px; background-color: #ddf8f3">
-						<view class="icon" style="color: #22b789">&#xe606;</view>
-						<view class="title">
+					<view class="int" style="height: 65px; background-color: rgb(239 248 255)">
+						<view class="icon" style="color: #88a8d5">&#xe630;</view>
+						<view class="title" style="color: #88a8d5;">
 							<view>科室介绍</view>
 							<view class="desc">众多先进设备</view>
 						</view>
 					</view>
 				</view>
 				<view class="out" @click="go('/pages/introduction/index')">
-					<view class="int" style="height: 80px; background-color: #fff3e3">
-						<view class="icon" style="color: #fe9b01">&#xe636;</view>
+					<view class="int" style="height: 65px; background-color: #f6f4fe">
+						<view class="icon" style="color: #cdccfe">&#xec7d;</view>
 						<view class="title"></view>
-						<view class="title">
+						<view class="title" style="color: #a294e2;">
 							<view>医院指南</view>
-							<view class="desc">医院简介</view>
+							<view class="desc" style="color: #a294e2;">医院简介</view>
 						</view>
 					</view>
 				</view>
@@ -137,6 +137,7 @@ page {
 }
 .banner {
 	width: 100%;
+	height:140px;
 	border-radius: 7px;
 }
 .notice {
@@ -162,11 +163,12 @@ page {
 				border-radius: 9px;
 				text-align: center;
 				position: relative;
+				animation: bounceIn 1s;
 				.icon {
 					margin: 0 auto;
 					line-height: 39px;
 					color: $main-color;
-					font-size: 57px;
+					font-size: 45px;
 					position: absolute;
 					right: 10px;
 					bottom: 20px;
@@ -186,7 +188,6 @@ page {
 					.desc {
 						font-size: 14px;
 						padding-top: 5px;
-						color: $font-c;
 						font-weight: normal;
 					}
 				}
@@ -200,6 +201,8 @@ page {
 	image {
 		width: 100%;
 		border-radius: 50px;
+		animation: bounceIn 1s;
+		height: 66px;
 	}
 	.tit {
 		text-align: left;

+ 30 - 5
app/pages/user/bind/add.vue

@@ -3,7 +3,7 @@
 		<view class="form">
 			<view class="form_group">
 				<view class="lable">绑定方式</view>
-				<picker :range="bindType" @change="picker">
+				<picker :range="bindType" @change="picker($event, 'type')">
 					<input placeholder="请选择" :value="bindType[item.type]" :disabled="true" />
 					<view class="icon more">&#xe62b;</view>
 				</picker>
@@ -17,6 +17,13 @@
 				<input type="tel" v-model="item.value" placeholder="请输入手机号" v-if="item.type == 0" />
 				<input type="idcard" v-model="item.value" placeholder="请输入身份证" v-else />
 			</view>
+			<view class="form_group">
+				<view class="lable">就诊人关系</view>
+				<picker :range="relationship" range-key="dictLabel" @change="picker($event, 'relationship')">
+					<input placeholder="请选择" v-model="item.relationship" :disabled="true" />
+					<view class="icon more">&#xe62b;</view>
+				</picker>
+			</view>
 		</view>
 		<button class="btn" @click="add()">确认</button>
 	</view>
@@ -26,15 +33,33 @@
 export default {
 	data() {
 		return {
-			item: { type: 0 },
-			bindType: ['手机号', '身份证']
+			item: { type: 0, relationship: '自己' },
+			bindType: ['手机号', '身份证'],
+			relationship: []
 		};
 	},
+	onLoad() {
+		this.getRelationship();
+	},
 	methods: {
-		picker(e) {
-			this.item.type = e.detail.value;
+		picker(e, tag) {
+			if (tag == 'type') {
+				this.item.type = e.detail.value;
+			}
+			if (tag == 'relationship') {
+				this.item.relationship = this.relationship[e.detail.value].dictLabel;
+			}
 			this.$forceUpdate();
 		},
+		getRelationship() {
+			this.http.request({
+				url: '/app/common/type/nk_kinship',
+				loading: 'false',
+				success: (res) => {
+					this.relationship = res.data.data;
+				}
+			});
+		},
 		add() {
 			let rule = [
 				{ name: 'name', checkType: 'notnull', errorMsg: '请输入姓名' },

+ 1 - 0
app/pages/user/bind/index.vue

@@ -4,6 +4,7 @@
 			<view class="item" v-for="(item, index) in list" :key="index" @click="go('/pages/user/bind/detail?id=' + item.id)">
 				<view class="title omit">
 					<text>{{ item.patientName }}</text>
+					<text class="check" v-if="item.relationship">{{item.relationship}}</text>
 					<text class="check" v-if="item.state == 1">(当前就诊人)</text>
 				</view>
 				<view class="icon del" @click.stop="del(item)">&#xe641;</view>

+ 9 - 3
app/pages/user/index.vue

@@ -1,5 +1,5 @@
 <template>
-	<view class="main">
+	<view class="main animated fadeInDown">
 		<view class="user" @click="go(user.doctor ? '/pages/user/info' : '/pages/user/bind/index')">
 			<image :src="user.avatar ? ip + user.avatar : '../../static/favicon.png'" :class="user.avatar ? 'head' : ''"></image>
 			<view class="con" v-if="user.id || user.token">
@@ -10,6 +10,7 @@
 				<view v-else>
 					<view class="nickName">
 						<text>{{ user.patientName ? user.patientName : '还未绑定就诊人' }}</text>
+						<text v-if="user.relationship" class="relationship">({{ user.relationship }})</text>
 						<text class="icon" v-if="user.bindUserList && user.bindUserList.length > 1" @click.stop="show = true">&#xe6a7;切换就诊人</text>
 					</view>
 					<view class="welcome">欢迎使用岑溪人民医院小程序</view>
@@ -75,12 +76,12 @@
 					<text class="icon arrow">&#xe62b;</text>
 				</view>
 			</view>
-			<button class="s_item" open-type="share" @click="go('/pages/help/my')" hover-class="none">
+			<button class="s_item" open-type="share" hover-class="none">
 				<text class="icon ic" style="color: #f44336">&#xe7c4;</text>
 				<text class="title">分享应用</text>
 				<text class="icon arrow">&#xe62b;</text>
 			</button>
-			<button class="s_item" open-type="feedback" @click="go('/pages/help/my')">
+			<button class="s_item" open-type="feedback" hover-class="none">
 				<text class="icon ic" style="color: #4caf50">&#xe62c;</text>
 				<text class="title">建议反馈</text>
 				<text class="icon arrow">&#xe62b;</text>
@@ -179,6 +180,11 @@ export default {
 			padding-left: 15px;
 			.nickName {
 				padding-top: 5px;
+				.relationship {
+					color: #7c7c7c;
+					font-size: 13px;
+					padding-left: 3px;
+				}
 				.icon {
 					padding-left: 6px;
 					font-size: 13px;

+ 18 - 6
app/pages/user/login.vue

@@ -1,7 +1,9 @@
 <template>
 	<view>
+		<back></back>
+		<image src="https://chenglantimes.com/prod-api/profile/upload/2024/08/27/1724751981292.jpg" mode="widthFix" style="width: 100%"></image>
 		<view class="bg">
-			<image src="https://axure-file.lanhuapp.com/md5__f93627286149f825890eb821ab5d5abb.png" class="pic" mode="widthFix"></image>
+			<image src="https://axure-file.lanhuapp.com/md5__f93627286149f825890eb821ab5d5abb.png" mode="widthFix" class="llg animated fadeInDown"></image>
 			<view class="xy">
 				<u-checkbox-group class="checkbox" v-model="item.checked">
 					<u-checkbox size="15" shape="circle" label="我已阅读并同意" labelSize="14" name="true"></u-checkbox>
@@ -78,18 +80,28 @@ export default {
 </script>
 
 <style lang="scss">
+page {
+	background-color: white;
+}
 .bg {
-	padding: 0px 30px;
-	.pic {
+	padding: 30px;
+	position: relative;
+	margin-top: -30px;
+	background-color: white;
+	border-radius: 25px 25px 0px 0px;
+	text-align: center;
+	.llg{
+		margin: 0 auto;
+		border-radius: 25px;
+		margin-bottom: 15px;
 		width: 100%;
-		border-radius: 5px;
+		height: 222px;
 	}
 }
 .doctor {
 	position: fixed;
 	width: 100%;
-	bottom: 0px;
-	background-color: #e1e1e1;
+	bottom: 10px;
 	.login {
 		text-align: center;
 		padding: 20px;

+ 2 - 0
app/pages/visit/detail.vue

@@ -9,6 +9,8 @@
 				<view class="item" v-for="(item, index) in item">
 					<view class="topTitle">{{ titleType(item.diagnosticType) }}</view>
 					<view class="title">{{ item.diagnosticName }}</view>
+					<view class="doc">主治医生: {{item.doctor}} </view>
+					<view class="dept">就诊科室: {{item.departmentName}} </view>
 					<view class="botBox">
 						<view class="time">诊断时间: {{item.diagnosisTime}} </view>
 						<view class="type">{{ diaCode(item.diagnosticCategoryCode) }}</view>

+ 5 - 3
app/pages/visit/doctor/detail.vue

@@ -4,11 +4,13 @@
 			<view class="nameBox">
 				<view class="name">{{patientName}}</view>
 			</view>
-			<view class="cardNum">{{patId}}</view>
+			<view class="cardNum">{{cardId}}</view>
 			<view class="list">
 				<view class="item" v-for="(item, index) in item">
 					<view class="topTitle">{{ titleType(item.diagnosticType) }}</view>
 					<view class="title">{{ item.diagnosticName }}</view>
+					<view class="doc">主治医生: {{item.doctor}} </view>
+					<view class="dept">就诊科室: {{item.departmentName}} </view>
 					<view class="botBox">
 						<view class="time">诊断时间: {{item.diagnosisTime}} </view>
 						<view class="type">{{ diaCode(item.diagnosticCategoryCode) }}</view>
@@ -25,12 +27,12 @@
 			return {
 				item: [],
 				patientName:'',
-				patId:'',
+				cardId:'',
 			}
 		},
 		onLoad(e) {
 			console.log(e);
-			this.patId = e.patId
+			this.cardId = e.cardId
 			this.patientName = e.patientName
 			this.http.request({
 				url: '/work/diagnosis/list?visitId=' + e.id,

+ 2 - 2
app/pages/visit/index.vue

@@ -34,7 +34,7 @@
 		<u-popup :show="showChange" @close="closePopup" @open="openPopup" :round="10" :closeable="true">
 			<view>
 				<view class="userChangeTitle">请选择就诊人</view>
-				<scroll-view scroll-y="true" class="scroll-Y" style="height: 300px;">
+				<scroll-view scroll-y="true" class="scroll-Y" style="max-height: 300px;">
 						<u-radio-group v-model="param.patientId" iconPlacement="left" placement="column">
 							<u-radio v-for="(item,index) in userList" :name="item.patientId"  @change="groupChange(item)"
 								:customStyle="{ backgroundColor: '#F8F8F8', margin:'5px 20px',borderRadius: '10px',padding: '10px'}">
@@ -266,4 +266,4 @@
 			padding: 5px 10px;
 		}
 	}
-</style>
+</style>

+ 8 - 1
app/uni_modules/uview-ui/components/u-action-sheet/u-action-sheet.vue

@@ -68,7 +68,9 @@
 									<text
 									    class="u-action-sheet__item-wrap__item__name"
 									    :style="[itemStyle(index)]"
-									>{{ item.patientName }}</text>
+									>{{ item.patientName }}
+									<text class="relationship" v-if="item.relationship">({{item.relationship}})</text>
+									</text>
 									<text
 									    style="width: 90%;color: blue;margin-top: 5px;"
 									    v-if="item.subname"
@@ -275,5 +277,10 @@
 		&--hover {
 			background-color: $u-action-sheet-cancel-text-hover-background-color;
 		}
+		.relationship{
+			color: #7c7c7c;
+			font-size: 13px;
+			padding-left: 3px;
+		}
 	}
 </style>

+ 6 - 2
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java

@@ -109,7 +109,7 @@ public class SysRoleController extends BaseController {
         role.setUpdateBy(getUsername());
 
         if (roleService.updateRole(role) > 0) {
-            permissionService.refreshRolePermission(role.getRoleId());
+            permissionService.refreshRolePermission(role.getRoleId(),role.getDataScope());
             return AjaxResult.success();
         }
         return AjaxResult.error("修改角色'" + role.getRoleName() + "'失败,请联系管理员");
@@ -124,7 +124,11 @@ public class SysRoleController extends BaseController {
     public AjaxResult dataScope(@RequestBody SysRole role) {
         roleService.checkRoleAllowed(role);
         roleService.checkRoleDataScope(role.getRoleId());
-        return toAjax(roleService.authDataScope(role));
+        int row=roleService.authDataScope(role);
+        if(row>0){
+            permissionService.refreshRolePermission(role.getRoleId(),role.getDataScope());
+        }
+        return toAjax(row);
     }
 
     /**

+ 7 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/api/Api_DepartmentController.java

@@ -1,6 +1,7 @@
 package com.ruoyi.web.work.api;
 
 import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.entity.SysDept;
 import com.ruoyi.system.service.ISysDeptService;
 import com.ruoyi.web.work.api.config.BaseController;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -27,6 +28,12 @@ public class Api_DepartmentController extends BaseController {
         return deptService.treeList();
     }
 
+    @GetMapping("/selectDeptList")
+    public AjaxResult selectDeptList(SysDept dept) {
+        dept.setStatus("0");
+        return AjaxResult.success(deptService.selectDeptList(dept));
+    }
+
     @GetMapping(value = "/detail/{id}")
     public AjaxResult detail(@PathVariable("id") Long id) {
         return AjaxResult.success(deptService.getById(id));

+ 3 - 2
ruoyi-admin/src/main/java/com/ruoyi/web/work/api/Api_DoctorController.java

@@ -1,6 +1,7 @@
 package com.ruoyi.web.work.api;
 
 import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.entity.SysUser;
 import com.ruoyi.system.service.ISysUserService;
 import com.ruoyi.web.work.api.config.BaseController;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -17,8 +18,8 @@ public class Api_DoctorController extends BaseController {
     private ISysUserService userService;
 
     @GetMapping("/list")
-    public AjaxResult list(Long deptId) {
-        return AjaxResult.success(userService.selectDoctor(deptId));
+    public AjaxResult list(SysUser user) {
+        return AjaxResult.success(userService.selectDoctor(user));
     }
 
     @GetMapping(value = "/detail/{id}")

+ 3 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/domain/BindUser.java

@@ -30,6 +30,9 @@ public class BindUser{
     @ApiModelProperty(value = "患者姓名")
     private String patientName;
 
+    @ApiModelProperty(value = "关系")
+    private String relationship;
+
     @ApiModelProperty(value = "状态:0=未启用,1=当前就诊人")
     private Integer state;
 

+ 3 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/domain/User.java

@@ -32,6 +32,9 @@ public class User{
     @ApiModelProperty(value = "当前患者姓名")
     private String patientName;
 
+    @ApiModelProperty(value = "当前关系")
+    private String relationship;
+
     @ApiModelProperty(value = "状态:0=正常,1=停用")
     private Integer state;
 

+ 3 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/domain/dto/BindDto.java

@@ -21,4 +21,7 @@ public class BindDto {
     @NotBlank(message = "手机号或身份证不能为空")
     private String value;
 
+    @NotBlank(message = "关系不能为空")
+    private String relationship;
+
 }

+ 5 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/work/service/impl/BindUserServiceImpl.java

@@ -53,6 +53,7 @@ public class BindUserServiceImpl extends ServiceImpl<BindUserMapper, BindUser> i
         bindUser.setPatientId(patient.getId());
         bindUser.setUserId(AppUtil.getUser().getId());
         bindUser.setPatientName(patient.getName());
+        bindUser.setRelationship(dto.getRelationship());
         if (bindUserMapper.selectBindUser(bindUser) != null) {
             return AjaxResult.error("你已绑定过该就诊人");
         }
@@ -63,8 +64,9 @@ public class BindUserServiceImpl extends ServiceImpl<BindUserMapper, BindUser> i
             User user = AppUtil.getUser();
             user.setPatientId(patient.getId());
             user.setPatientName(patient.getName());
+            user.setRelationship(dto.getRelationship());
             if (!userService.updateById(user)) {
-                throw new ServerException("绑定就诊人失败");
+                throw new ServerException("缓存信息过期,绑定就诊人失败,请重新登录再试");
             }
             tokenService.setLoginUser(user);
         }
@@ -87,6 +89,7 @@ public class BindUserServiceImpl extends ServiceImpl<BindUserMapper, BindUser> i
         if (bindUser.getPatientId().equals(AppUtil.getUser().getPatientId())) {
             User user = AppUtil.getUser();
             user.setPatientName("");
+            user.setRelationship("");
             user.setPatientId(0l);
             userService.updateById(user);
             tokenService.setLoginUser(user);
@@ -107,6 +110,7 @@ public class BindUserServiceImpl extends ServiceImpl<BindUserMapper, BindUser> i
         User user = AppUtil.getUser();
         user.setPatientId(bindUser.getPatientId());
         user.setPatientName(bindUser.getPatientName());
+        user.setRelationship(bindUser.getRelationship());
         if (!userService.updateById(user)) {
             throw new ServerException("切换就诊人失败");
         }

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/work/service/impl/FollowRecordServiceImpl.java

@@ -38,7 +38,7 @@ public class FollowRecordServiceImpl extends ServiceImpl<FollowRecordMapper, Fol
     @Autowired
     private Environment env;
 
-    @DataScope(deptAlias = "k")
+    @DataScope(deptAlias = "k",userAlias = "k")
     @Override
     public List<FollowRecord> selectList(FollowRecord followRecord) {
         return followRecordMapper.selectList(followRecord);

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/work/service/impl/FollowTemplateServiceImpl.java

@@ -19,7 +19,7 @@ public class FollowTemplateServiceImpl extends ServiceImpl<FollowTemplateMapper,
     @Autowired
     private FollowTemplateMapper followTemplateMapper;
 
-    @DataScope(deptAlias = "k")
+    @DataScope(deptAlias = "k",userAlias = "k")
     @Override
     public List<FollowTemplate> selectList(FollowTemplate followTemplate) {
         return followTemplateMapper.selectList(followTemplate);

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/work/service/impl/KnowledgeServiceImpl.java

@@ -32,7 +32,7 @@ public class KnowledgeServiceImpl extends ServiceImpl<KnowledgeMapper, Knowledge
     }
 
     @Override
-    @DataScope(deptAlias = "k")
+    @DataScope(deptAlias = "k",userAlias = "k")
     public List<Knowledge> selectList(Knowledge knowledge) {
         knowledge.setState(0);
         return knowledgeMapper.selectList(knowledge);

+ 13 - 11
ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysPermissionService.java

@@ -1,21 +1,20 @@
 package com.ruoyi.framework.web.service;
 
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
 import com.ruoyi.common.constant.CacheConstants;
-import com.ruoyi.common.constant.Constants;
+import com.ruoyi.common.core.domain.entity.SysRole;
+import com.ruoyi.common.core.domain.entity.SysUser;
 import com.ruoyi.common.core.domain.model.LoginUser;
 import com.ruoyi.common.core.redis.RedisCache;
+import com.ruoyi.system.service.ISysMenuService;
+import com.ruoyi.system.service.ISysRoleService;
 import com.ruoyi.system.service.ISysUserService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
-import com.ruoyi.common.core.domain.entity.SysRole;
-import com.ruoyi.common.core.domain.entity.SysUser;
-import com.ruoyi.system.service.ISysMenuService;
-import com.ruoyi.system.service.ISysRoleService;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
 
 /**
  * 用户权限处理
@@ -88,13 +87,16 @@ public class SysPermissionService {
      *
      * @param roleId
      */
-    public void refreshRolePermission(Long roleId) {
+    public void refreshRolePermission(Long roleId,String...dataScope) {
         Collection<String> keys = redisCache.keys(CacheConstants.LOGIN_TOKEN_KEY + "*");
         for (String key : keys) {
             LoginUser loginUser = redisCache.getCacheObject(key);
             if (loginUser != null) {
                 for (SysRole r : loginUser.getUser().getRoles()) {
                     if (r.getRoleId().equals(roleId)) {
+                        if(dataScope.length>0){
+                            r.setDataScope(dataScope[0]);
+                        }
                         loginUser.setPermissions(getMenuPermission(loginUser.getUser()));
                         tokenService.setLoginUser(loginUser);
                     }

+ 1 - 2
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java

@@ -129,8 +129,7 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
     public SysUser checkEmailUnique(String email);
 
 
-    @Select("SELECT user_id AS id,nick_name AS name,avatar,brief FROM sys_user WHERE dept_id=#{deptId} AND status='0'  ORDER BY user_id DESC")
-    List<Map<String, Object>> selectDoctor(@Param("deptId") Long deptId);
+    List<Map<String, Object>> selectDoctor(SysUser user);
 
     @Select("SELECT nick_name AS name,avatar,introduce FROM sys_user WHERE user_id=#{userId} AND status='0'")
     Map<String, Object> detail(@Param("userId") Long userId);

+ 1 - 1
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserService.java

@@ -213,7 +213,7 @@ public interface ISysUserService extends IService<SysUser> {
      * @param deptId
      * @return
      */
-    List<Map<String, Object>> selectDoctor(Long deptId);
+    List<Map<String, Object>> selectDoctor(SysUser user);
 
     /**
      * 医生详情

+ 6 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java

@@ -67,6 +67,12 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
     public AjaxResult treeList() {
         List<Map<String, Object>> all = deptMapper.treeList();
         List<Map<String, Object>> list = all.stream().filter(r -> r.get("parentId").toString().equals("100")).collect(Collectors.toList());
+        for (Map record : list) {
+            List<Map<String, Object>> children = all.stream().filter(r -> r.get("parentId").toString().equals(record.get("deptId").toString())).collect(Collectors.toList());
+            if (children.size() > 0) {
+                record.put("children", children);
+            }
+        }
         return AjaxResult.success(list);
     }
 

+ 2 - 2
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java

@@ -493,8 +493,8 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
     }
 
     @Override
-    public List<Map<String, Object>> selectDoctor(Long deptId) {
-        return userMapper.selectDoctor(deptId);
+    public List<Map<String, Object>> selectDoctor(SysUser user) {
+        return userMapper.selectDoctor(user);
     }
 
     @Override

+ 8 - 0
ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml

@@ -40,6 +40,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="leader"    column="leader"      />
         <result property="status"    column="dept_status" />
     </resultMap>
+
+	<select id="selectDoctor" resultType="java.util.Map">
+		SELECT user_id AS id,nick_name AS name,avatar,brief FROM sys_user
+		WHERE status='0'
+			<if test="deptId != null"> AND dept_id=#{deptId}</if>
+			<if test="nickName != null and nickName != ''">AND nick_name like concat('%', #{nickName}, '%')</if>
+		ORDER BY user_id DESC
+	</select>
 	
     <resultMap id="RoleResult" type="SysRole">
         <id     property="roleId"       column="role_id"        />