准备验证
This commit is contained in:
@@ -10,7 +10,8 @@
|
||||
placeholder="请选择学院"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 200px">
|
||||
style="width: 200px"
|
||||
@change="handleDeptChange">
|
||||
<el-option
|
||||
v-for="item in deptList"
|
||||
:key="item.deptCode"
|
||||
@@ -27,7 +28,7 @@
|
||||
filterable
|
||||
style="width: 200px">
|
||||
<el-option
|
||||
v-for="item in classList"
|
||||
v-for="item in filteredClassList"
|
||||
:key="item.classCode"
|
||||
:label="item.classNo"
|
||||
:value="item.classCode">
|
||||
@@ -48,7 +49,7 @@
|
||||
v-model:showSearch="showSearch"
|
||||
class="ml10 mr20"
|
||||
style="float: right;"
|
||||
@queryTable="getDataList">
|
||||
@queryTable="getDataList">
|
||||
</right-toolbar>
|
||||
</div>
|
||||
</el-row>
|
||||
@@ -72,12 +73,12 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="createTime" label="创建时间" show-overflow-tooltip align="center" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ scope.row.createTime ? scope.row.createTime.split(' ')[0] + ' ' + scope.row.createTime.split(' ')[1] : '-' }}</span>
|
||||
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="updateTime" label="更新时间" show-overflow-tooltip align="center" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ scope.row.updateTime ? scope.row.updateTime.split(' ')[0] + ' ' + scope.row.updateTime.split(' ')[1] : '-' }}</span>
|
||||
<span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="150" align="center" fixed="right">
|
||||
@@ -103,12 +104,13 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="PendingWork">
|
||||
import { reactive, ref, onMounted } from 'vue'
|
||||
import { reactive, ref, onMounted, computed } from 'vue'
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table";
|
||||
import { fetchList } from "/@/api/stuwork/pendingwork";
|
||||
import { getDeptList } from "/@/api/basic/basicclass";
|
||||
import { getClassListByRole } from "/@/api/basic/basicclass";
|
||||
import { useMessage } from "/@/hooks/message";
|
||||
import { parseTime } from "/@/utils/formatTime";
|
||||
|
||||
// 定义变量内容
|
||||
const searchFormRef = ref()
|
||||
@@ -154,6 +156,11 @@ const handleReset = () => {
|
||||
getDataList()
|
||||
}
|
||||
|
||||
// 学院变化时,清空班级选择并过滤班级列表
|
||||
const handleDeptChange = () => {
|
||||
searchForm.classCode = ''
|
||||
}
|
||||
|
||||
// 查看详情
|
||||
const handleView = (row: any) => {
|
||||
useMessage().warning('查看详情功能待实现')
|
||||
@@ -179,6 +186,8 @@ const getClassListData = async () => {
|
||||
const res = await getClassListByRole()
|
||||
if (res.data) {
|
||||
classList.value = Array.isArray(res.data) ? res.data : []
|
||||
} else {
|
||||
classList.value = []
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('获取班级列表失败', err)
|
||||
@@ -186,6 +195,14 @@ const getClassListData = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 根据学院过滤班级列表
|
||||
const filteredClassList = computed(() => {
|
||||
if (!searchForm.deptCode) {
|
||||
return classList.value
|
||||
}
|
||||
return classList.value.filter((item: any) => item.deptCode === searchForm.deptCode)
|
||||
})
|
||||
|
||||
// 初始化
|
||||
onMounted(() => {
|
||||
getDeptListData()
|
||||
@@ -193,3 +210,6 @@ onMounted(() => {
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
</style>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user