소스 검색

fix:修复bug

lsw 9 달 전
부모
커밋
e342e28df6
2개의 변경된 파일11개의 추가작업 그리고 7개의 파일을 삭제
  1. 10 7
      app/pages/doctor/index.vue
  2. 1 0
      ruoyi-admin/src/main/java/com/ruoyi/web/work/controller/FollowRecordController.java

+ 10 - 7
app/pages/doctor/index.vue

@@ -5,8 +5,8 @@
 		</view>
 		<view class="left">
 			<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 :title="d.deptName" :name="d.deptId" v-for="(d, index) in list" :key="d.deptId">
+					<view :class="{ active: index == i.current }" v-for="(i, index) in d.children" :key="i.deptId" class="item" @click="selected(i, index)">{{ i.deptName }}</view>
 				</u-collapse-item>
 			</u-collapse>
 		</view>
@@ -16,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>
@@ -49,11 +49,14 @@ export default {
 				}
 			});
 		},
-		open() {
-			this.current = -1;
-		},
 		selected(item, index) {
-			this.list.flatMap((i) => i.children).forEach((j) => (j.current = -1));
+			this.list.forEach((i) => {
+				if (i.children) {
+					i.children.forEach((j) => {
+						j.current = -1;
+					});
+				}
+			});
 			item.current = index;
 			this.http.request({
 				url: '/app/doctor/list',

+ 1 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/controller/FollowRecordController.java

@@ -58,6 +58,7 @@ public class FollowRecordController extends BaseController {
     @PreAuthorize("@ss.hasAnyPermi('work:record:list,work:up:list')")
     @GetMapping("/template/list")
     public AjaxResult templateList(FollowTemplate followTemplate) {
+        followTemplate.setState(0);
         List<FollowTemplate> list = followTemplateService.selectList(followTemplate);
         return AjaxResult.success(list);
     }