Browse Source

feat: 添加分组组件

windyeasy 3 months ago
parent
commit
d9162ba110

+ 38 - 0
src/components/group/group.vue

@@ -0,0 +1,38 @@
+<script lang="ts" setup>
+interface IProps {
+  name?: string
+}
+withDefaults(defineProps<IProps>(), {
+  name: '',
+})
+const isCollapsed = ref(true)
+
+function changeIsCollapsed() {
+  isCollapsed.value = !isCollapsed.value
+}
+</script>
+
+<template>
+  <view class="group">
+    <view class="group-head flex justify-between" @click="changeIsCollapsed">
+      <view class="head-left flex items-center px-[24rpx] py-1 bg-white">
+        <wd-icon name="caret-right-small" size="30px" color="#888" v-if="isCollapsed"></wd-icon>
+        <wd-icon name="caret-down-small" size="30px" color="#888" v-else></wd-icon>
+        <view class="group-name">{{ name }}</view>
+      </view>
+      <view class="head-right">
+        <slot name="head-right"></slot>
+      </view>
+    </view>
+    <view class="group-content" v-if="!isCollapsed">
+      <slot></slot>
+    </view>
+  </view>
+</template>
+
+<style lang="scss" scoped>
+.head-left {
+  font-size: 32rpx;
+  font-weight: bold;
+}
+</style>

+ 5 - 15
src/pages/profile/index.vue

@@ -22,32 +22,22 @@
 const list = ref([
   {
     icon: 'address-list',
-    text: '团队通讯录',
+    text: '诊单记录',
     link: '',
   },
   {
     icon: 'group',
-    text: '团队分组',
+    text: '患者信息',
     link: '',
   },
   {
     icon: 'team-info',
-    text: '团队信息',
-    link: '',
+    text: '医疗团队管理',
+    link: '/pages/team-managent/index',
   },
   {
     icon: 'scheduling',
-    text: '团队排班',
-    link: '',
-  },
-  {
-    icon: 'statistics',
-    text: '团队统计',
-    link: '',
-  },
-  {
-    icon: 'tags',
-    text: '团队标签',
+    text: '系统通知',
     link: '',
   },
 ])

+ 3 - 1
src/pages/team-managent/directory/index.vue

@@ -8,7 +8,9 @@
 </route>
 
 <template>
-  <view class="management-directory">团队通讯录</view>
+  <view class="management-directory">
+    <group name="分组一组">测试分组组件</group>
+  </view>
 </template>
 
 <script lang="ts" setup>

+ 1 - 1
src/pages/team-managent/index.vue

@@ -21,7 +21,7 @@ const list = ref([
   {
     icon: 'address-list',
     text: '团队通讯录',
-    link: '',
+    link: '/pages/team-managent/directory/index',
   },
   {
     icon: 'group',