|
@@ -10,9 +10,10 @@ import {
|
|
|
List,
|
|
|
PullRefresh,
|
|
|
ActionSheet,
|
|
|
- showToast
|
|
|
+ showToast,
|
|
|
+ Sticky
|
|
|
} from 'vant'
|
|
|
-import { defineComponent, reactive, ref, onMounted } from 'vue'
|
|
|
+import { defineComponent, reactive, ref, onMounted, watch } from 'vue'
|
|
|
import { useRouter } from 'vue-router'
|
|
|
import styles from './attent-student.module.less'
|
|
|
import request from '@/helpers/request'
|
|
@@ -21,7 +22,13 @@ import { courseEmnu } from '@/constant'
|
|
|
import TeacherAttItem from '../modals/teacherAtt-item'
|
|
|
export default defineComponent({
|
|
|
name: 'attend-student',
|
|
|
- setup() {
|
|
|
+ props: {
|
|
|
+ toHeight: {
|
|
|
+ type: Number,
|
|
|
+ default: 0
|
|
|
+ }
|
|
|
+ },
|
|
|
+ setup(props) {
|
|
|
const router = useRouter()
|
|
|
const state = reactive({
|
|
|
showPopoverTime: false,
|
|
@@ -42,6 +49,7 @@ export default defineComponent({
|
|
|
page: 1,
|
|
|
rows: 20
|
|
|
})
|
|
|
+ const toTop = ref(props.toHeight)
|
|
|
const minDate = ref(new Date(dayjs().subtract(10, 'year').format('YYYY-MM-DD')))
|
|
|
const maxDate = ref(new Date(dayjs().add(10, 'year').format('YYYY-MM-DD')))
|
|
|
const columnsType = ref<DatePickerColumnType[]>(['year', 'month'])
|
|
@@ -69,7 +77,10 @@ export default defineComponent({
|
|
|
}
|
|
|
|
|
|
forms.page = res.data.current + 1
|
|
|
- list.value = list.value.concat(res.data.rows || [])
|
|
|
+ for (let i = 0; i < 10; i++) {
|
|
|
+ list.value = list.value.concat(res.data.rows || [])
|
|
|
+ }
|
|
|
+
|
|
|
showContact.value = list.value.length > 0
|
|
|
loading.value = false
|
|
|
|
|
@@ -93,6 +104,7 @@ export default defineComponent({
|
|
|
forms.time = val.selectedValues[0] + '-' + val.selectedValues[1]
|
|
|
forms.timeName = val.selectedValues[0] + '年' + val.selectedValues[1] + '月'
|
|
|
state.showPopoverTime = false
|
|
|
+ refreshing.value = true
|
|
|
getList()
|
|
|
}
|
|
|
const checkOrchestra = (val: any) => {
|
|
@@ -110,14 +122,9 @@ 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 }
|
|
|
+ data: { page: 1, rows: 9999 }
|
|
|
})
|
|
|
state.actions = res.data.rows.map((item) => {
|
|
|
return {
|
|
@@ -131,7 +138,13 @@ export default defineComponent({
|
|
|
showToast(message)
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ watch(
|
|
|
+ () => props.toHeight,
|
|
|
+ (val: number) => {
|
|
|
+ toTop.value = val
|
|
|
+ console.log(toTop.value, '老师的')
|
|
|
+ }
|
|
|
+ )
|
|
|
onMounted(() => {
|
|
|
getOrchestraList()
|
|
|
getList()
|
|
@@ -146,55 +159,57 @@ export default defineComponent({
|
|
|
}
|
|
|
return () => (
|
|
|
<>
|
|
|
- {/* <OSticky position="top" background="#F8F8F8"> */}
|
|
|
- <OSearch
|
|
|
- placeholder="请输入伴学指导姓名"
|
|
|
- inputBackground="white"
|
|
|
- background="#f6f6f6"
|
|
|
- onSearch={(val: any) => {
|
|
|
- console.log(val, 'onSearch')
|
|
|
- forms.keyword = val
|
|
|
- refreshing.value = true
|
|
|
- getList()
|
|
|
- }}
|
|
|
- ></OSearch>
|
|
|
- <div class={styles.chioseWrap}>
|
|
|
- <div style={{ padding: '12px 13px', background: '#F8F8F8' }}>
|
|
|
- <div
|
|
|
- class={styles.searchBand}
|
|
|
- onClick={() => {
|
|
|
- state.showPopoverTime = true
|
|
|
+ <Sticky offsetTop={toTop.value}>
|
|
|
+ <div>
|
|
|
+ <OSearch
|
|
|
+ placeholder="请输入伴学指导姓名"
|
|
|
+ inputBackground="white"
|
|
|
+ background="#f6f6f6"
|
|
|
+ onSearch={(val: any) => {
|
|
|
+ console.log(val, 'onSearch')
|
|
|
+ forms.keyword = val
|
|
|
+ refreshing.value = true
|
|
|
+ getList()
|
|
|
}}
|
|
|
- >
|
|
|
- {forms.timeName}
|
|
|
- <Icon name={state.showPopoverTime ? 'arrow-up' : 'arrow-down'} />
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ ></OSearch>
|
|
|
+ <div class={styles.chioseWrap}>
|
|
|
+ <div style={{ padding: '12px 13px', background: '#F8F8F8' }}>
|
|
|
+ <div
|
|
|
+ class={styles.searchBand}
|
|
|
+ onClick={() => {
|
|
|
+ state.showPopoverTime = true
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ {forms.timeName}
|
|
|
+ <Icon name={state.showPopoverTime ? 'arrow-up' : 'arrow-down'} />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
|
|
|
- <div style={{ padding: '12px 13px', background: '#F8F8F8' }}>
|
|
|
- <div
|
|
|
- class={styles.searchBand}
|
|
|
- onClick={() => {
|
|
|
- state.showPopoverOrchestra = true
|
|
|
- }}
|
|
|
- >
|
|
|
- {forms.orchestraName}
|
|
|
- <Icon name={state.showPopoverOrchestra ? 'arrow-up' : 'arrow-down'} />
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div style={{ padding: '12px 13px', background: '#F8F8F8' }}>
|
|
|
- <div
|
|
|
- class={styles.searchBand}
|
|
|
- onClick={() => {
|
|
|
- state.showPopoverSubject = true
|
|
|
- }}
|
|
|
- >
|
|
|
- {forms.courseTypeName}
|
|
|
- <Icon name={state.showPopoverSubject ? 'arrow-up' : 'arrow-down'} />
|
|
|
+ <div style={{ padding: '12px 13px', background: '#F8F8F8' }}>
|
|
|
+ <div
|
|
|
+ class={styles.searchBand}
|
|
|
+ onClick={() => {
|
|
|
+ state.showPopoverOrchestra = true
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ {forms.orchestraName}
|
|
|
+ <Icon name={state.showPopoverOrchestra ? 'arrow-up' : 'arrow-down'} />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div style={{ padding: '12px 13px', background: '#F8F8F8' }}>
|
|
|
+ <div
|
|
|
+ class={styles.searchBand}
|
|
|
+ onClick={() => {
|
|
|
+ state.showPopoverSubject = true
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ {forms.courseTypeName}
|
|
|
+ <Icon name={state.showPopoverSubject ? 'arrow-up' : 'arrow-down'} />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- {/* </OSticky> */}
|
|
|
+ </Sticky>
|
|
|
|
|
|
{showContact.value ? (
|
|
|
<PullRefresh v-model={refreshing.value} onRefresh={onRefresh}>
|