|
@@ -49,13 +49,58 @@
|
|
|
</div>
|
|
|
<div class="right">456</div>
|
|
|
</div>
|
|
|
+ <!-- 放置每一个医院的科室的数据 -->
|
|
|
+ <div class="department">
|
|
|
+ <div class="leftNav">
|
|
|
+ <ul>
|
|
|
+ <li
|
|
|
+ @click="changeIndex(index)"
|
|
|
+ v-for="(department, index) in hospitalStore.departMentArr"
|
|
|
+ :key="department.depcode"
|
|
|
+ :class="{ active: index == currentIndex }"
|
|
|
+ >
|
|
|
+ {{ department.depname }}
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
+ <div class="departmentInfo">
|
|
|
+ <div
|
|
|
+ class="showDepartment"
|
|
|
+ v-for="department in hospitalStore.departMentArr"
|
|
|
+ >
|
|
|
+ <h1 class="cur">{{ department.depname }}</h1>
|
|
|
+ <ul>
|
|
|
+ <li v-for="item in department.children">
|
|
|
+ {{ item.depname }}
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
import useDetaileStore from "@/store/modules/hospitalDetail";
|
|
|
+import { ref } from "vue";
|
|
|
|
|
|
let hospitalStore = useDetaileStore();
|
|
|
+
|
|
|
+//高亮处理的响应式数据
|
|
|
+let currentIndex = ref<number>(0);
|
|
|
+
|
|
|
+//点击事件
|
|
|
+const changeIndex = (index: number) => {
|
|
|
+ currentIndex.value = index;
|
|
|
+ //获取右侧h1标题
|
|
|
+ let allH1 = document.querySelectorAll(".cur");
|
|
|
+
|
|
|
+ //滚动到对应科室的位置
|
|
|
+ allH1[currentIndex.value].scrollIntoView({
|
|
|
+ behavior: "smooth",
|
|
|
+ block: "center",
|
|
|
+ });
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|
|
@@ -91,5 +136,58 @@ let hospitalStore = useDetaileStore();
|
|
|
flex: 1;
|
|
|
}
|
|
|
}
|
|
|
+ .department {
|
|
|
+ width: 100%;
|
|
|
+ height: 500px;
|
|
|
+ display: flex;
|
|
|
+ .leftNav {
|
|
|
+ width: 80px;
|
|
|
+ height: 100%;
|
|
|
+ ul {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ background: rgb(248, 248, 248);
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ li {
|
|
|
+ flex: 1;
|
|
|
+ text-align: center;
|
|
|
+ color: #7f7f7f;
|
|
|
+ font-size: 14px;
|
|
|
+ line-height: 40px;
|
|
|
+ &.active {
|
|
|
+ color: red;
|
|
|
+ background: white;
|
|
|
+ border-left: 1px solid red;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .departmentInfo {
|
|
|
+ flex: 1;
|
|
|
+ height: 100%;
|
|
|
+ overflow: auto;
|
|
|
+ &::-webkit-scrollbar {
|
|
|
+ display: none;
|
|
|
+ }
|
|
|
+ .showDepartment {
|
|
|
+ h1 {
|
|
|
+ background: rgb(248, 248, 248);
|
|
|
+ color: #7f7f7f;
|
|
|
+ height: 30px;
|
|
|
+ line-height: 30px;
|
|
|
+ }
|
|
|
+ ul {
|
|
|
+ display: flex;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ li {
|
|
|
+ color: #7f7f7f;
|
|
|
+ width: 33%;
|
|
|
+ line-height: 30px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|