Browse Source

练习记录+keyword

1
mo 2 năm trước cách đây
mục cha
commit
e53b8a5d18

+ 8 - 0
src/router/routes-school.ts

@@ -196,6 +196,14 @@ export default [
         meta: {
           title: '我的审批'
         }
+      },
+      {
+        path: '/student-leave',
+        name: 'student-leave',
+        component: () => import('@/school/approval-manage/components/student-leave'),
+        meta: {
+          title: '审批详情'
+        }
       }
       //
     ]

+ 19 - 2
src/school/approval-manage/components/approval-item.module.less

@@ -31,8 +31,25 @@
       }
     }
     .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;
+      }
     }
   }
   .itemWrapBottom {

+ 14 - 2
src/school/approval-manage/components/approval-item.tsx

@@ -1,7 +1,8 @@
 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 { Icon, ActionSheet } from 'vant'
 import dayjs from 'dayjs'
@@ -26,7 +27,18 @@ export default defineComponent({
                 {dayjs(props.item.createTime).format('YYYY-MM-DD hh:mm')}
               </p>
             </div>
-            <div class={styles.itemWrapTopRight}></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}
           </div>
           <div class={styles.itemWrapBottom}>
             <div class={styles.courseInfo}>

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

@@ -0,0 +1,21 @@
+import OHeader from '@/components/o-header'
+import OSticky from '@/components/o-sticky'
+import { Tabs, Tab } from 'vant'
+import { defineComponent, reactive, ref } from 'vue'
+import styles from './index.module.less'
+import { useRouter } from 'vue-router'
+
+const activeName = ref('wait')
+export default defineComponent({
+  name: 'approval-manage',
+  setup() {
+    const router = useRouter()
+    const state = reactive({})
+
+    return () => (
+      <>
+        <div></div>
+      </>
+    )
+  }
+})

+ 23 - 1
src/school/approval-manage/components/wait-approval.tsx

@@ -59,6 +59,21 @@ 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()
     })
@@ -74,7 +89,14 @@ export default defineComponent({
                 onLoad={getList}
               >
                 {list.value.map((item: any) => (
-                  <ApprovalItem item={item} type="wait"></ApprovalItem>
+                  <div
+                    onClick={() => {
+                      gotoDetail(item)
+                    }}
+                  >
+                    {' '}
+                    <ApprovalItem item={item} type="wait"></ApprovalItem>
+                  </div>
                 ))}
               </List>
             </PullRefresh>

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


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


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

@@ -49,6 +49,7 @@ export default defineComponent({
       subjectName: '全部声部',
       sortType: '',
       sortTypeName: '',
+      keyword: '',
       page: 1,
       rows: 20
     })
@@ -181,9 +182,11 @@ 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()
             }}
           ></OSearch>