Bladeren bron

Merge branch 'master' of http://git.dayaedu.com/lex/orchestra-app

lex 2 jaren geleden
bovenliggende
commit
8ab937a8e4
25 gewijzigde bestanden met toevoegingen van 624 en 90 verwijderingen
  1. 9 1
      src/router/routes-school.ts
  2. 69 17
      src/school/approval-manage/components/approval-item.module.less
  3. 36 13
      src/school/approval-manage/components/approval-item.tsx
  4. 87 0
      src/school/approval-manage/components/end-approval.tsx
  5. 43 0
      src/school/approval-manage/components/student-course-item.tsx
  6. 80 0
      src/school/approval-manage/components/student-leave.module.less
  7. 111 0
      src/school/approval-manage/components/student-leave.tsx
  8. 74 0
      src/school/approval-manage/components/studnet-course-item.module.less
  9. 3 0
      src/school/approval-manage/components/wait-approval.module.less
  10. 44 17
      src/school/approval-manage/components/wait-approval.tsx
  11. BIN
      src/school/approval-manage/images/card-icon.png
  12. BIN
      src/school/approval-manage/images/date-icon.png
  13. BIN
      src/school/approval-manage/images/eidit-icon.png
  14. BIN
      src/school/approval-manage/images/pass-icon.png
  15. BIN
      src/school/approval-manage/images/quest-icon.png
  16. BIN
      src/school/approval-manage/images/unpass-icon.png
  17. 4 2
      src/school/approval-manage/index.tsx
  18. 26 24
      src/school/attendance/components/attend-student.tsx
  19. 1 1
      src/school/attendance/components/attend-teacher.tsx
  20. 8 6
      src/school/attendance/index.tsx
  21. 2 1
      src/school/attendance/student-att-day.tsx
  22. 2 2
      src/school/exercise-record/exercis-detail.tsx
  23. 24 5
      src/school/exercise-record/index.tsx
  24. 1 1
      src/school/exercise-record/modals/student-item.module.less
  25. BIN
      src/school/images/Image4.png

+ 9 - 1
src/router/routes-school.ts

@@ -177,7 +177,7 @@ export default [
         name: 'attendance',
         component: () => import('@/school/attendance/index'),
         meta: {
-          title: '考勤管理'
+          title: '异常考勤'
         }
       },
       {
@@ -203,6 +203,14 @@ export default [
         meta: {
           title: '我的审批'
         }
+      },
+      {
+        path: '/student-leave',
+        name: 'student-leave',
+        component: () => import('@/school/approval-manage/components/student-leave'),
+        meta: {
+          title: '审批详情'
+        }
       }
       //
     ]

+ 69 - 17
src/school/approval-manage/components/approval-item.module.less

@@ -31,8 +31,28 @@
       }
     }
     .itemWrapTopRight {
-      font-size: 12px;
-      color: #777;
+      display: flex;
+      flex-direction: row;
+      align-items: center;
+      .passLabel {
+        font-size: 14px;
+        font-weight: 500;
+        color: #4ab78e;
+        line-height: 20px;
+      }
+      .unpassLabel {
+        font-size: 14px;
+        font-weight: 500;
+        color: #f44541;
+        line-height: 20px;
+      }
+      .passIcon {
+        font-size: 16px;
+        margin-right: 4px;
+      }
+      .msgIcon {
+        font-size: 24px;
+      }
     }
   }
   .itemWrapBottom {
@@ -42,26 +62,58 @@
       display: flex;
       flex-direction: row;
       align-items: center;
-      padding-bottom: 15px;
-      .headImgs {
-        width: 42px;
-        height: 42px;
-        border-radius: 50%;
-        overflow: hidden;
-        margin-right: 12px;
+      justify-content: space-between;
+      // padding-bottom: 15px;
+      .courseInfoLeft {
+        display: flex;
+        flex-direction: row;
+        align-items: center;
+        .headImgs {
+          width: 48px;
+          height: 48px;
+          border-radius: 50%;
+          overflow: hidden;
+          margin-right: 10px;
+        }
+        .infoMsg {
+          .infoMsgMain {
+            font-size: 16px;
+            font-weight: 600;
+            color: #333333;
+            line-height: 22px;
+          }
+          .infoMsgSub {
+            font-size: 12px;
+            font-weight: 500;
+            color: #ffffff;
+            line-height: 19px;
+            padding: 1px 8px;
+            border-radius: 4px;
+            margin-top: 3px;
+            text-align: center;
+          }
+          .student {
+            background-color: #ff8057;
+          }
+          .teacher {
+            background-color: #64a9ff;
+          }
+        }
       }
-      .infoMsg {
-        .infoMsgMain {
+      .courseInfoRight {
+        display: flex;
+        flex-direction: row;
+        align-items: center;
+        .approvalType {
           font-size: 16px;
-          font-weight: 600;
+          font-weight: 500;
           color: #333333;
-          line-height: 22px;
+          // line-height: 22px;
+          margin-right: 16px;
         }
-        .infoMsgSub {
+        .icons {
           font-size: 12px;
-          font-weight: 400;
-          color: #777777;
-          line-height: 17px;
+          color: #d8d8d8;
         }
       }
     }

+ 36 - 13
src/school/approval-manage/components/approval-item.tsx

@@ -1,8 +1,10 @@
 import { defineComponent, reactive, ref } from 'vue'
 import styles from './approval-item.module.less'
 import clockIcon from '@/school/attendance/images/clock-icon.png'
-
+import passIcon from '../images/pass-icon.png'
+import unpassIcon from '../images/unpass-icon.png'
 import defaultIcon from '@/school/images/default-icon.jpg'
+import msgIcon from '@/school/images/msg-icon.png'
 import { Icon, ActionSheet } from 'vant'
 import dayjs from 'dayjs'
 import { useRouter } from 'vue-router'
@@ -23,23 +25,44 @@ export default defineComponent({
                 <img src={clockIcon} alt="" />
               </div>
               <p class={styles.leftTimer}>
-                {dayjs(props.item.startTime).format('YYYY-MM-DD hh:mm')}
-                {'-'}
-                {dayjs(props.item.endTime).format('hh:mm')}
+                {dayjs(props.item.createTime).format('YYYY-MM-DD hh:mm')}
               </p>
             </div>
-            <div class={styles.itemWrapTopRight}>
-              <Icon name="arrow"></Icon>
-            </div>
+            {props.type == 'end' && props.item.status == 'PASS' ? (
+              <div class={styles.itemWrapTopRight}>
+                <Icon class={styles.passIcon} name={passIcon}></Icon>
+                <p class={styles.passLabel}>通过</p>
+              </div>
+            ) : null}
+            {props.type == 'end' && props.item.status == 'UNPASS' ? (
+              <div class={styles.itemWrapTopRight}>
+                <Icon class={styles.passIcon} name={unpassIcon}></Icon>
+                <p class={styles.unpassLabel}>拒绝</p>
+              </div>
+            ) : null}
+            {props.type == 'doing' && props.item.status == 'DOING' ? (
+              <div class={styles.itemWrapTopRight}>
+                <Icon class={styles.msgIcon} name={msgIcon}></Icon>
+              </div>
+            ) : null}
           </div>
           <div class={styles.itemWrapBottom}>
             <div class={styles.courseInfo}>
-              <img class={styles.headImgs} src={defaultIcon} alt="" />
-              <div class={styles.infoMsg}>
-                <p class={styles.infoMsgMain}>
-                  {props.item.classGroupName}-{props.item.teacherName}
-                </p>
-                <p class={styles.infoMsgSub}>{props.item.orchestraName}</p>
+              <div class={styles.courseInfoLeft}>
+                <img class={styles.headImgs} src={defaultIcon} alt="" />
+                <div class={styles.infoMsg}>
+                  <p class={styles.infoMsgMain}>{props.item.nickName}</p>
+                  {props.item.clientType == 'STUDENT' ? (
+                    <p class={[styles.infoMsgSub, styles.student]}>学生</p>
+                  ) : (
+                    <p class={[styles.infoMsgSub, styles.teacher]}>老师</p>
+                  )}
+                </div>
+              </div>
+              <div class={styles.courseInfoRight}>
+                {props.item.leaveCategoryId == 1 ? <p class={styles.approvalType}>请假</p> : null}
+                {props.item.leaveCategoryId == 2 ? <p class={styles.approvalType}>退团</p> : null}
+                {props.type != 'doing' ? <Icon class={styles.icons} name="arrow"></Icon> : null}
               </div>
             </div>
           </div>

+ 87 - 0
src/school/approval-manage/components/end-approval.tsx

@@ -0,0 +1,87 @@
+import OEmpty from '@/components/o-empty'
+import dayjs from 'dayjs'
+import { List, PullRefresh, showToast } from 'vant'
+import { defineComponent, reactive, ref, onMounted } from 'vue'
+import { useRouter } from 'vue-router'
+import styles from './wait-approval.module.less'
+import request from '@/helpers/request'
+import ApprovalItem from './approval-item'
+export default defineComponent({
+  name: 'end-approval',
+  setup() {
+    const router = useRouter()
+    const forms = reactive({
+      page: 1,
+      rows: 20
+    })
+
+    const refreshing = ref(false)
+    const loading = ref(false)
+    const finished = ref(false)
+    const showContact = ref(false)
+    const list = ref([])
+
+    const getList = async () => {
+      console.log('getList')
+      loading.value = true
+      try {
+        if (refreshing.value) {
+          forms.page = 1
+          list.value = []
+          refreshing.value = false
+        }
+
+        const res = await request.post('/api-school/userLeaveRecord/page', {
+          data: { ...forms, hasHandle: true }
+        })
+
+        if (list.value.length > 0 && res.data.pages === 1) {
+          return
+        }
+        forms.page = res.data.current + 1
+        list.value = list.value.concat(res.data.rows || [])
+        showContact.value = list.value.length > 0
+        loading.value = false
+        finished.value = res.data.current >= res.data.pages
+      } catch (e: any) {
+        // console.log(e, 'e')
+        const message = e.message
+        showToast(message)
+        showContact.value = false
+        finished.value = true
+      }
+    }
+    const onRefresh = () => {
+      finished.value = false
+      // 重新加载数据
+      // 将 loading 设置为 true,表示处于加载状态
+      loading.value = true
+      getList()
+    }
+    onMounted(() => {
+      getList()
+    })
+    return () => (
+      <>
+        <div class={styles.approvalWrap}>
+          {showContact.value ? (
+            <PullRefresh v-model={refreshing.value} onRefresh={onRefresh}>
+              <List
+                v-model:loading={loading.value}
+                finished={finished.value}
+                finished-text="没有更多了"
+                onLoad={getList}
+              >
+                {list.value.map((item: any) => (
+                  <ApprovalItem item={item} type="end"></ApprovalItem>
+                ))}
+              </List>
+            </PullRefresh>
+          ) : (
+            <OEmpty />
+          )}
+        </div>
+      </>
+    )
+  }
+})

+ 43 - 0
src/school/approval-manage/components/student-course-item.tsx

@@ -0,0 +1,43 @@
+import { defineComponent, reactive, ref } from 'vue'
+import styles from './studnet-course-item.module.less'
+import clockIcon from '@/school/attendance/images/clock-icon.png'
+import passIcon from '../images/pass-icon.png'
+import unpassIcon from '../images/unpass-icon.png'
+import defaultIcon from '@/school/images/default-icon.jpg'
+import msgIcon from '@/school/images/msg-icon.png'
+import { Icon, ActionSheet } from 'vant'
+import dayjs from 'dayjs'
+import { useRouter } from 'vue-router'
+export default defineComponent({
+  props: ['item', 'type'],
+  name: 'student-course-item',
+  setup(props) {
+    const router = useRouter()
+    const gotoStudentDetail = () => {
+      // router.push({ path: '/student-att-day', query: { time: props.item.time } })
+    }
+    return () => (
+      <>
+        <div class={styles.itemWrap}>
+          <div class={styles.itemWrapTop}>
+            <div class={styles.itemWrapTopLeft}>
+              <div class={styles.clockWrap}>
+                <img src={clockIcon} alt="" />
+              </div>
+              <p class={styles.leftTimer}>
+                {dayjs(props.item.startTime).format('YYYY-MM-DD hh:mm')} -
+                {dayjs(props.item.endTime).format('hh:mm')}
+              </p>
+            </div>
+          </div>
+          <div class={styles.itemWrapBottom}>
+            <p class={styles.itemWrapBottomMain}>
+              {props.item.className}-{props.item.teacherName}
+            </p>
+            <p class={styles.itemWrapBottomSub}>{props.item.orchestraName}</p>
+          </div>
+        </div>
+      </>
+    )
+  }
+})

+ 80 - 0
src/school/approval-manage/components/student-leave.module.less

@@ -0,0 +1,80 @@
+.leaveWrap {
+  margin-top: 12px;
+  .subTitle {
+    display: flex;
+    flex-direction: row;
+    align-items: center;
+    .subTitleIcon {
+      font-size: 20px;
+      margin-right: 6px;
+    }
+    span {
+      font-size: 16px;
+      font-weight: 500;
+      color: #333333;
+      line-height: 22px;
+    }
+  }
+  .leaveInfo {
+    margin: 12px 13px 20px;
+    background-color: #fff;
+    border-radius: 10px;
+    padding: 15px 12px 20px;
+    .leaveDate {
+      margin-top: 10px;
+      font-size: 15px;
+      font-family: PingFangSC-Regular, PingFang SC;
+      font-weight: 400;
+      color: #333333;
+      line-height: 21px;
+      margin-bottom: 25px;
+    }
+    .leaveReason {
+      margin-top: 10px;
+      font-size: 15px;
+      font-family: PingFangSC-Regular, PingFang SC;
+      font-weight: 400;
+      color: #333333;
+      line-height: 21px;
+    }
+  }
+  .courseWrap {
+    margin: 20px 13px;
+    // padding: 0px 0px 20px;
+    .courseWrapTitlte {
+      padding: 0 12px;
+    }
+    .courseList {
+      padding-top: 10px;
+    }
+  }
+  .reasonWrap {
+    margin: 0 13px;
+    border-radius: 10px;
+    overflow: hidden;
+    background-color: #fff;
+    .bottomIcon {
+      font-size: 20px;
+      margin-right: 6px;
+    }
+    .van-field {
+      padding: 0 12px;
+      min-height: 200px;
+    }
+    .reasonLabelLeft {
+      display: flex;
+      flex-direction: row;
+      align-items: center;
+      font-size: 16px;
+      font-weight: 500;
+      color: #333333;
+      line-height: 22px;
+    }
+  }
+  .btnWrap {
+    margin-top: 30px;
+    .unpassBtn {
+      border-radius: 22px;
+    }
+  }
+}

+ 111 - 0
src/school/approval-manage/components/student-leave.tsx

@@ -0,0 +1,111 @@
+import OHeader from '@/components/o-header'
+import OSticky from '@/components/o-sticky'
+import { Tabs, Tab, showToast, Icon, Field, Button } from 'vant'
+import { defineComponent, onMounted, reactive, ref } from 'vue'
+import styles from './student-leave.module.less'
+import { useRouter, useRoute } from 'vue-router'
+import request from '@/helpers/request'
+import ApprovalItem from './approval-item'
+import cardICon from '../images/card-icon.png'
+import dateICon from '../images/date-icon.png'
+import eiditICon from '../images/eidit-icon.png'
+import questICon from '../images/quest-icon.png'
+import StudentCourseItem from './student-course-item'
+const activeName = ref('wait')
+const item = ref({} as any)
+const courseScheduleList = ref([] as any)
+export default defineComponent({
+  name: 'approval-manage',
+  setup() {
+    const router = useRouter()
+    const route = useRoute()
+    const state = reactive({})
+
+    const getLeaveDetail = async () => {
+      try {
+        const { data } = await request.get(
+          `/api-school/userLeaveRecord/detail/${route.query.id}`,
+          {}
+        )
+        item.value = data
+        courseScheduleList.value = data.courseScheduleList || []
+      } catch (e: any) {
+        // console.log(e, 'e')
+        const message = e.message
+        showToast(message)
+      }
+    }
+    onMounted(() => {
+      getLeaveDetail()
+    })
+    return () => (
+      <>
+        <div class={styles.leaveWrap}>
+          <OSticky>
+            <OHeader isBack={true}></OHeader>
+          </OSticky>
+          <ApprovalItem item={item.value} type="doing"></ApprovalItem>
+          <div class={styles.leaveInfo}>
+            <p class={styles.subTitle}>
+              <Icon class={styles.subTitleIcon} name={dateICon}></Icon>
+              <span>请假日期</span>
+            </p>
+            <p class={styles.leaveDate}>2022-10-25 - 2022-10-28</p>
+            <p class={styles.subTitle}>
+              <Icon class={styles.subTitleIcon} name={questICon}></Icon>
+              <span>请假原因</span>
+            </p>
+            <p class={styles.leaveReason}>请假</p>
+          </div>
+
+          <div class={styles.courseWrap}>
+            <div class={styles.courseWrapTitlte}>
+              {' '}
+              <p class={styles.subTitle}>
+                <Icon class={styles.subTitleIcon} name={cardICon}></Icon>
+                <span>涉及课程</span>
+              </p>
+            </div>
+
+            <div class={styles.courseList}>
+              {courseScheduleList.value.map((item) => (
+                <StudentCourseItem item={item}></StudentCourseItem>
+              ))}
+              {/* {item.value?.courseScheduleList} */}
+            </div>
+          </div>
+
+          <div class={styles.reasonWrap}>
+            <Field
+              label-align="top"
+              maxlength={400}
+              autosize
+              type="textarea"
+              rows={5}
+              placeholder="请输入你的审批意见"
+            >
+              {{
+                label: () => (
+                  <div>
+                    <div class={styles.reasonLabelLeft}>
+                      {' '}
+                      <Icon class={styles.bottomIcon} name={eiditICon}></Icon> <span>意见审批</span>
+                    </div>
+                  </div>
+                )
+              }}
+            </Field>
+          </div>
+          <div class={['btnGroup btnMore', styles.btnWrap]}>
+            <Button color="#ccc" class={styles.unpassBtn}>
+              拒绝
+            </Button>
+            <Button color="#FF8057" class={styles.unpassBtn}>
+              通过
+            </Button>
+          </div>
+        </div>
+      </>
+    )
+  }
+})

+ 74 - 0
src/school/approval-manage/components/studnet-course-item.module.less

@@ -0,0 +1,74 @@
+.itemWrap {
+  padding: 12px 15px 15px;
+  border-radius: 10px;
+  background-color: #fff;
+  // margin: 0 13px 12px;
+  .itemWrapTop {
+    display: flex;
+    flex-direction: row;
+    align-items: center;
+    justify-content: space-between;
+    padding-bottom: 12px;
+    border-bottom: 1px solid #f2f2f2;
+    .itemWrapTopLeft {
+      display: flex;
+      flex-direction: row;
+      align-items: center;
+      .clockWrap {
+        width: 18px;
+        height: 18px;
+        margin-right: 6px;
+        img {
+          width: 100%;
+          height: 100%;
+        }
+      }
+      .leftTimer {
+        font-size: 14px;
+        font-weight: 500;
+        color: #333333;
+        line-height: 20px;
+      }
+    }
+    .itemWrapTopRight {
+      display: flex;
+      flex-direction: row;
+      align-items: center;
+      .passLabel {
+        font-size: 14px;
+        font-weight: 500;
+        color: #4ab78e;
+        line-height: 20px;
+      }
+      .unpassLabel {
+        font-size: 14px;
+        font-weight: 500;
+        color: #f44541;
+        line-height: 20px;
+      }
+      .passIcon {
+        font-size: 16px;
+        margin-right: 4px;
+      }
+      .msgIcon {
+        font-size: 24px;
+      }
+    }
+  }
+  .itemWrapBottom {
+    padding-top: 15px;
+    .itemWrapBottomMain {
+      margin-bottom: 4px;
+      font-size: 16px;
+      font-weight: 600;
+      color: #333333;
+      line-height: 22px;
+    }
+    .itemWrapBottomSub {
+      font-size: 14px;
+      font-weight: 400;
+      color: #777777;
+      line-height: 20px;
+    }
+  }
+}

+ 3 - 0
src/school/approval-manage/components/wait-approval.module.less

@@ -0,0 +1,3 @@
+.approvalWrap {
+  margin-top: 12px;
+}

+ 44 - 17
src/school/approval-manage/components/wait-approval.tsx

@@ -32,7 +32,7 @@ export default defineComponent({
         }
 
         const res = await request.post('/api-school/userLeaveRecord/page', {
-          data: { ...forms }
+          data: { ...forms, hasHandle: false }
         })
 
         if (list.value.length > 0 && res.data.pages === 1) {
@@ -59,24 +59,51 @@ export default defineComponent({
       loading.value = true
       getList()
     }
+
+    const gotoDetail = (row: any) => {
+      console.log(row)
+      // leaveCategoryId 1请假 2退团
+      if (row.clientType == 'STUDENT') {
+        if (row.leaveCategoryId == 1) {
+          // 请假
+          router.push({ path: '/student-leave', query: { id: row.id } })
+        } else {
+          // 退团
+        }
+      } else {
+        console.log('老师请假')
+      }
+    }
+    onMounted(() => {
+      getList()
+    })
     return () => (
       <>
-        {showContact.value ? (
-          <PullRefresh v-model={refreshing.value} onRefresh={onRefresh}>
-            <List
-              v-model:loading={loading.value}
-              finished={finished.value}
-              finished-text="没有更多了"
-              onLoad={getList}
-            >
-              {list.value.map((item: any) => (
-                <ApprovalItem item={item} type="wait"></ApprovalItem>
-              ))}
-            </List>
-          </PullRefresh>
-        ) : (
-          <OEmpty />
-        )}
+        <div class={styles.approvalWrap}>
+          {showContact.value ? (
+            <PullRefresh v-model={refreshing.value} onRefresh={onRefresh}>
+              <List
+                v-model:loading={loading.value}
+                finished={finished.value}
+                finished-text="没有更多了"
+                onLoad={getList}
+              >
+                {list.value.map((item: any) => (
+                  <div
+                    onClick={() => {
+                      gotoDetail(item)
+                    }}
+                  >
+                    {' '}
+                    <ApprovalItem item={item} type="wait"></ApprovalItem>
+                  </div>
+                ))}
+              </List>
+            </PullRefresh>
+          ) : (
+            <OEmpty />
+          )}
+        </div>
       </>
     )
   }

BIN
src/school/approval-manage/images/card-icon.png


BIN
src/school/approval-manage/images/date-icon.png


BIN
src/school/approval-manage/images/eidit-icon.png


BIN
src/school/approval-manage/images/pass-icon.png


BIN
src/school/approval-manage/images/quest-icon.png


BIN
src/school/approval-manage/images/unpass-icon.png


+ 4 - 2
src/school/approval-manage/index.tsx

@@ -4,6 +4,8 @@ import { Tabs, Tab } from 'vant'
 import { defineComponent, reactive, ref } from 'vue'
 import styles from './index.module.less'
 import { useRouter } from 'vue-router'
+import WaitApproval from './components/wait-approval'
+import EndApproval from './components/end-approval'
 const activeName = ref('wait')
 export default defineComponent({
   name: 'approval-manage',
@@ -17,10 +19,10 @@ export default defineComponent({
           <OHeader isBack={true}></OHeader>
           <Tabs v-model:active={activeName.value} class={styles.approvalTab}>
             <Tab name="wait" title="待审批">
-              待审批
+              <WaitApproval></WaitApproval>
             </Tab>
             <Tab name="end" title="已完成">
-              已完成
+              <EndApproval></EndApproval>
             </Tab>
           </Tabs>
         </OSticky>

+ 26 - 24
src/school/attendance/components/attend-student.tsx

@@ -1,5 +1,5 @@
 import OSearch from '@/components/o-search'
-import oEmpty from '@/components/o-empty'
+import OEmpty from '@/components/o-empty'
 import dayjs from 'dayjs'
 import {
   Icon,
@@ -48,9 +48,12 @@ export default defineComponent({
     const finished = ref(false)
     const showContact = ref(false)
     const list = ref([])
-
+    const schoolId = globalState.user.data.schoolInfos
+      .map((item) => {
+        return item.id
+      })
+      .join(',')
     const getList = async () => {
-      console.log('getList')
       loading.value = true
       try {
         if (refreshing.value) {
@@ -62,17 +65,18 @@ export default defineComponent({
         const res = await request.post(
           '/api-school/courseScheduleStudentAttendance/studentAttendance',
           {
-            data: { ...forms }
+            data: { ...forms, schoolId: schoolId }
           }
         )
-
+        console.log(list.value, 'list.value')
         if (list.value.length > 0 && res.data.pages === 1) {
           return
         }
 
         // forms.page = res.data.current + 1
         list.value = res.data
-        // showContact.value = list.value.length > 0
+
+        showContact.value = list.value.length > 0
         // console.log(showContact.value, ' showContact.value ')
         loading.value = false
 
@@ -108,11 +112,6 @@ export default defineComponent({
       getList()
     }
     const getOrchestraList = async () => {
-      const schoolId = globalState.user.data.schoolInfos
-        .map((item) => {
-          return item.id
-        })
-        .join(',')
       try {
         const res = await request.post('/api-school/orchestra/page', {
           data: { page: 1, rows: 9999, schoolId }
@@ -201,19 +200,22 @@ export default defineComponent({
         </div>
         {/* </OSticky> */}
 
-        {}
-        <PullRefresh v-model={refreshing.value} onRefresh={onRefresh}>
-          <List
-            v-model:loading={loading.value}
-            finished={finished.value}
-            finished-text="没有更多了"
-            onLoad={getList}
-          >
-            {list.value.map((item: any) => (
-              <StudentAttItem item={item}></StudentAttItem>
-            ))}
-          </List>
-        </PullRefresh>
+        {showContact.value ? (
+          <PullRefresh v-model={refreshing.value} onRefresh={onRefresh}>
+            <List
+              v-model:loading={loading.value}
+              finished={finished.value}
+              finished-text="没有更多了"
+              onLoad={getList}
+            >
+              {list.value.map((item: any) => (
+                <StudentAttItem item={item}></StudentAttItem>
+              ))}
+            </List>
+          </PullRefresh>
+        ) : (
+          <OEmpty></OEmpty>
+        )}
 
         <Popup v-model:show={state.showPopoverTime} position="bottom" style="{ height: '30%' }">
           <DatePicker

+ 1 - 1
src/school/attendance/components/attend-teacher.tsx

@@ -60,7 +60,7 @@ export default defineComponent({
           refreshing.value = false
         }
 
-        const res = await request.post('api-school/courseSchedule/teacherAttendance', {
+        const res = await request.post('/api-school/courseSchedule/teacherAttendance', {
           data: { ...forms }
         })
 

+ 8 - 6
src/school/attendance/index.tsx

@@ -17,14 +17,16 @@ export default defineComponent({
         <OSticky position="top" background="#F8F8F8">
           <OHeader isBack={true}></OHeader>
           <Tabs v-model:active={activeName.value}>
-            <Tab name="student" title="学生考勤">
-              <AttendStudent></AttendStudent>
-            </Tab>
-            <Tab name="teacher" title="伴学指导考勤">
-              <AttendTeacher></AttendTeacher>
-            </Tab>
+            <Tab name="student" title="学生考勤"></Tab>
+            <Tab name="teacher" title="伴学指导考勤"></Tab>
           </Tabs>
         </OSticky>
+
+        {activeName.value == 'student' ? (
+          <AttendStudent></AttendStudent>
+        ) : (
+          <AttendTeacher></AttendTeacher>
+        )}
       </>
     )
   }

+ 2 - 1
src/school/attendance/student-att-day.tsx

@@ -49,7 +49,6 @@ export default defineComponent({
     const list = ref([])
 
     const getList = async () => {
-      console.log('getList')
       loading.value = true
       try {
         if (refreshing.value) {
@@ -86,6 +85,7 @@ export default defineComponent({
       forms.timeName =
         val.selectedValues[0] + '年' + val.selectedValues[1] + '月' + val.selectedValues[2] + '日'
       state.showPopoverTime = false
+      refreshing.value = true
       getList()
     }
 
@@ -122,6 +122,7 @@ export default defineComponent({
           background="#f6f6f6"
           onSearch={(val: any) => {
             forms.nickName = val
+            refreshing.value = true
             getList()
           }}
           modelValue={forms.nickName}

+ 2 - 2
src/school/exercise-record/exercis-detail.tsx

@@ -177,7 +177,7 @@ export default defineComponent({
                     {infoDetail.value.practiceTimes ? infoDetail.value.practiceTimes : 0}{' '}
                     <span>分钟</span>
                   </p>
-                  <p class={styles.infoDaysub}>练习天数</p>
+                  <p class={styles.infoDaysub}>练习时长</p>
                 </div>
               </div>
             </div>
@@ -262,7 +262,7 @@ export default defineComponent({
                 <p>
                   练习数据是学生通过云教练自主练习的数据统计,可根据时间段查询学生的练习天数和练习时长{' '}
                 </p>
-                <p>练习天数:当天曲目播放或测评记录即算练习</p>
+                <p>练习天数:当天曲目播放或测评记录即算练习</p>
                 <p>练习时长:曲目播放和曲目测评的时长总和</p>
               </div>
             )

+ 24 - 5
src/school/exercise-record/index.tsx

@@ -22,7 +22,6 @@ import { state as globalState } from '@/state'
 import { useRouter } from 'vue-router'
 import styles from './index.module.less'
 import request from '@/helpers/request'
-
 export default defineComponent({
   name: 'exercise-record',
   setup() {
@@ -35,8 +34,17 @@ export default defineComponent({
       actions: [] as any,
       subjects: [] as any,
       actionSorts: [
-        { text: '按天数', value: 'PRACTICE_DAY' },
-        { text: '按时长', value: 'PRACTICE_TIMES' }
+        {
+          text: '按天数',
+          value: 'PRACTICE_DAY',
+          color: '#f67146'
+        },
+        {
+          text: '按时长',
+          value: 'PRACTICE_TIMES',
+          color: '#333'
+        }
+        //   color: forms.sortType == 'PRACTICE_DAY' ? '#FF8057' : '#333'
       ],
       currentDate: [dayjs().format('YYYY'), dayjs().format('MM')]
     })
@@ -49,9 +57,11 @@ export default defineComponent({
       subjectName: '全部声部',
       sortType: '',
       sortTypeName: '',
+      keyword: '',
       page: 1,
       rows: 20
     })
+
     const minDate = ref(new Date(dayjs().subtract(5, 'year').format('YYYY-MM-DD')))
     const maxDate = ref(new Date(dayjs().add(5, 'year').format('YYYY-MM-DD')))
     const columnsType = ref<DatePickerColumnType[]>(['year', 'month'])
@@ -104,6 +114,13 @@ export default defineComponent({
     const checkSort = (val: any) => {
       forms.sortType = val.value
       forms.sortTypeName = val.text
+      state.actionSorts.forEach((element) => {
+        if (element.value == val.value) {
+          element.color = '#f67146'
+        } else {
+          element.color = '#333'
+        }
+      })
       refreshing.value = true
       getList()
     }
@@ -111,6 +128,7 @@ export default defineComponent({
       forms.practiceMonth = val.selectedValues[0] + val.selectedValues[1]
       forms.practiceMonthName = val.selectedValues[0] + '年' + val.selectedValues[1] + '月'
       state.showPopoverTime = false
+      refreshing.value = true
       getList()
     }
     const checkOrchestra = (val: any) => {
@@ -181,8 +199,9 @@ export default defineComponent({
         <OSticky position="top" background="#F8F8F8">
           <OHeader isBack={true} onHeaderBack={onBack}></OHeader>
           <OSearch
-            placeholder="学生编号"
-            onSearch={() => {
+            placeholder="请输入学生姓名"
+            onSearch={(val: any) => {
+              forms.keyword = val
               refreshing.value = true
               getList()
             }}

+ 1 - 1
src/school/exercise-record/modals/student-item.module.less

@@ -59,7 +59,7 @@
     }
   }
   .itemBottom {
-    padding: 0 10px 10px;
+    padding: 10px;
     display: flex;
     flex-direction: row;
     align-items: center;

BIN
src/school/images/Image4.png