|
@@ -1,15 +1,113 @@
|
|
|
import ColHeader from '@/components/col-header'
|
|
|
+import ColSearch from '@/components/col-search'
|
|
|
+import request from '@/helpers/request'
|
|
|
+import OrganSearch from '@/student/practice-class/model/organ-search'
|
|
|
+import { useRect } from '@vant/use'
|
|
|
+import { Icon, Popup, Sticky } from 'vant'
|
|
|
import { defineComponent } from 'vue'
|
|
|
import Student from '../components/student'
|
|
|
+import styles from './index.module.less'
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: 'myStudent',
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ searchStatus: false,
|
|
|
+ openStatus: false,
|
|
|
+ subjectList: [],
|
|
|
+ list: [],
|
|
|
+ dataShow: true, // 判断是否有数据
|
|
|
+ loading: false,
|
|
|
+ finished: false,
|
|
|
+ params: {
|
|
|
+ search: '',
|
|
|
+ subjectName: '全部声部',
|
|
|
+ subjectId: null as any,
|
|
|
+ page: 1,
|
|
|
+ rows: 20
|
|
|
+ },
|
|
|
+ height: 'auto' as any
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async mounted() {
|
|
|
+ try {
|
|
|
+ const res = await request.get('/api-teacher/subject/subjectSelect')
|
|
|
+ this.subjectList = res.data || []
|
|
|
+ } catch {}
|
|
|
+ // this.getList()
|
|
|
+
|
|
|
+ const { height } = useRect((this as any).$refs.headers)
|
|
|
+ this.height = height
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ onSort() {
|
|
|
+ this.params.page = 1
|
|
|
+ this.list = []
|
|
|
+ this.dataShow = true // 判断是否有数据
|
|
|
+ this.loading = false
|
|
|
+ this.finished = false
|
|
|
+ this.searchStatus = false
|
|
|
+ this.getList()
|
|
|
+ },
|
|
|
+ onSearch(val: string) {
|
|
|
+ this.params.search = val
|
|
|
+ this.onSort()
|
|
|
+ },
|
|
|
+ async getList() {}
|
|
|
+ },
|
|
|
render() {
|
|
|
return (
|
|
|
<>
|
|
|
- <ColHeader />
|
|
|
+ <Sticky>
|
|
|
+ <div ref="headers">
|
|
|
+ <ColHeader isFixed={false} border={false} />
|
|
|
+ <ColSearch
|
|
|
+ placeholder="请输入老师名称"
|
|
|
+ onSearch={this.onSearch}
|
|
|
+ v-slots={{
|
|
|
+ left: () => (
|
|
|
+ <div
|
|
|
+ class={styles.label}
|
|
|
+ onClick={() => {
|
|
|
+ this.searchStatus = !this.searchStatus
|
|
|
+ this.openStatus = !this.openStatus
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ {this.params.subjectName}
|
|
|
+ <Icon
|
|
|
+ classPrefix="iconfont"
|
|
|
+ name="down"
|
|
|
+ size={12}
|
|
|
+ color="#333"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ )
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </Sticky>
|
|
|
+
|
|
|
+ <Student>上次课程 1 天前</Student>
|
|
|
|
|
|
- <Student />
|
|
|
+ <Popup
|
|
|
+ show={this.searchStatus}
|
|
|
+ position="bottom"
|
|
|
+ round
|
|
|
+ closeable
|
|
|
+ safe-area-inset-bottom
|
|
|
+ onClose={() => (this.searchStatus = false)}
|
|
|
+ onClosed={() => (this.openStatus = false)}
|
|
|
+ >
|
|
|
+ {this.openStatus && (
|
|
|
+ <OrganSearch
|
|
|
+ subjectList={this.subjectList}
|
|
|
+ onSort={this.onSort}
|
|
|
+ isReset
|
|
|
+ v-model={this.params.subjectId}
|
|
|
+ v-model:subjectName={this.params.subjectName}
|
|
|
+ />
|
|
|
+ )}
|
|
|
+ </Popup>
|
|
|
</>
|
|
|
)
|
|
|
}
|