This commit is contained in:
RISE
2026-03-05 13:56:50 +08:00
parent bff8907f88
commit f047d9a461
4 changed files with 11821 additions and 2809 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,4 @@
import request from "/@/utils/request" import request from '/@/utils/request'
/** /**
* 根据分页查询参数获取列表数据。 * 根据分页查询参数获取列表数据。
@@ -9,7 +9,7 @@ export function fetchList(query?: Object) {
return request({ return request({
url: '/stuwork/weekPlan/page', url: '/stuwork/weekPlan/page',
method: 'get', method: 'get',
params: query params: query,
}) })
} }
@@ -22,7 +22,7 @@ export function addObj(obj?: Object) {
return request({ return request({
url: '/stuwork/weekPlan', url: '/stuwork/weekPlan',
method: 'post', method: 'post',
data: obj data: obj,
}) })
} }
@@ -35,7 +35,7 @@ export function getObj(obj?: Object) {
return request({ return request({
url: '/stuwork/weekPlan/detail', url: '/stuwork/weekPlan/detail',
method: 'get', method: 'get',
params: obj params: obj,
}) })
} }
@@ -48,7 +48,7 @@ export function delObjs(ids?: Object) {
return request({ return request({
url: '/stuwork/weekPlan/delete', url: '/stuwork/weekPlan/delete',
method: 'post', method: 'post',
data: ids data: ids,
}) })
} }
@@ -61,7 +61,20 @@ export function putObj(obj?: Object) {
return request({ return request({
url: '/stuwork/weekPlan/edit', url: '/stuwork/weekPlan/edit',
method: 'post', method: 'post',
data: obj data: obj,
})
}
/**
* 统计班主任查看情况
* GET /api/stuwork/weekPlan/readStatistics
* @param params 包含 deptCode, weekPlanId
*/
export function readStatistics(params: { deptCode: string; weekPlanId: string }) {
return request({
url: '/stuwork/weekPlan/readStatistics',
method: 'get',
params,
}) })
} }
@@ -71,7 +84,7 @@ export function putObj(obj?: Object) {
* @param {*} value - 要验证的值。 * @param {*} value - 要验证的值。
* @param {Function} callback - 验证完成后的回调函数。 * @param {Function} callback - 验证完成后的回调函数。
* @param {boolean} isEdit - 当前操作是否为编辑。 * @param {boolean} isEdit - 当前操作是否为编辑。
* *
* 示例用法: * 示例用法:
* 字段名: [ * 字段名: [
* { * {
@@ -84,17 +97,16 @@ export function putObj(obj?: Object) {
*/ */
export function validateExist(rule: any, value: any, callback: any, isEdit: boolean) { export function validateExist(rule: any, value: any, callback: any, isEdit: boolean) {
if (isEdit) { if (isEdit) {
return callback(); return callback()
} }
getObj({ [rule.field]: value }).then((response) => { getObj({ [rule.field]: value }).then(response => {
const result = response.data; const result = response.data
if (result !== null && result.length > 0) { if (result !== null && result.length > 0) {
callback(new Error('数据已经存在')); callback(new Error('数据已经存在'))
} else { } else {
callback(); callback()
} }
}); })
} }

View File

@@ -132,7 +132,7 @@
</template> </template>
</el-table-column> </el-table-column>
</template> </template>
<el-table-column label="操作" width="250" align="center" fixed="right"> <el-table-column label="操作" width="360" align="center" fixed="right">
<template #header> <template #header>
<el-icon><Setting /></el-icon> <el-icon><Setting /></el-icon>
<span style="margin-left: 4px">操作</span> <span style="margin-left: 4px">操作</span>
@@ -152,6 +152,13 @@
@click="formDialogRef.openDialog(scope.row.id)"> @click="formDialogRef.openDialog(scope.row.id)">
编辑 编辑
</el-button> </el-button>
<el-button
icon="Histogram"
link
type="success"
@click="handleReadStatistics(scope.row)">
查看班主任查看情况
</el-button>
<el-button <el-button
icon="Delete" icon="Delete"
link link
@@ -183,28 +190,32 @@
<!-- 详情对话框 --> <!-- 详情对话框 -->
<DetailDialog ref="detailDialogRef" @refresh="getDataList(false)" /> <DetailDialog ref="detailDialogRef" @refresh="getDataList(false)" />
<!-- 班主任查看情况统计 -->
<ReadStatisticsDialog ref="readStatisticsDialogRef" />
</div> </div>
</template> </template>
<script setup lang="ts" name="WeekPlan"> <script setup lang="ts" name="WeekPlan">
import { ref, reactive, defineAsyncComponent, onMounted, nextTick } from 'vue' import { ref, reactive, defineAsyncComponent, onMounted, nextTick } from 'vue'
import { BasicTableProps, useTable } from "/@/hooks/table"; import { BasicTableProps, useTable } from '/@/hooks/table'
import { fetchList, delObjs } from "/@/api/stuwork/weekplan"; import { fetchList, delObjs } from '/@/api/stuwork/weekplan'
import { useMessage, useMessageBox } from "/@/hooks/message"; import { useMessage, useMessageBox } from '/@/hooks/message'
import { queryAllSchoolYear } from '/@/api/basic/basicyear' import { queryAllSchoolYear } from '/@/api/basic/basicyear'
import TableColumnControl from '/@/components/TableColumnControl/index.vue' import TableColumnControl from '/@/components/TableColumnControl/index.vue'
import { import {
List, Calendar, Clock, Document, User, Setting, Menu, Search, EditPen List, Calendar, Clock, Document, User, Setting, Menu, Search, EditPen, Histogram,
} from '@element-plus/icons-vue' } from '@element-plus/icons-vue'
import { useTableColumnControl } from '/@/hooks/tableColumn' import { useTableColumnControl } from '/@/hooks/tableColumn'
// 引入组件 // 引入组件
const FormDialog = defineAsyncComponent(() => import('./form.vue')); const FormDialog = defineAsyncComponent(() => import('./form.vue'))
const DetailDialog = defineAsyncComponent(() => import('./detail.vue')); const DetailDialog = defineAsyncComponent(() => import('./detail.vue'))
const ReadStatisticsDialog = defineAsyncComponent(() => import('./readStatistics.vue'))
// 定义变量内容 // 定义变量内容
const formDialogRef = ref() const formDialogRef = ref()
const detailDialogRef = ref() const detailDialogRef = ref()
const readStatisticsDialogRef = ref()
const searchFormRef = ref() const searchFormRef = ref()
const columnControlRef = ref<any>() const columnControlRef = ref<any>()
// 搜索变量 // 搜索变量
@@ -261,7 +272,7 @@ const {
sizeChangeHandle, sizeChangeHandle,
sortChangeHandle, sortChangeHandle,
downBlobFile, downBlobFile,
tableStyle tableStyle,
} = useTable(state) } = useTable(state)
// 查询 // 查询
@@ -293,6 +304,16 @@ const handleViewDetail = async (id: string) => {
detailDialogRef.value?.openDialog(id) detailDialogRef.value?.openDialog(id)
} }
// 查看班主任查看情况统计
const handleReadStatistics = async (row: any) => {
if (!row?.id) {
useMessage().warning('未获取到每周工作ID')
return
}
await nextTick()
readStatisticsDialogRef.value?.openDialog(row.id)
}
// 删除操作 // 删除操作
const handleDelete = async (ids: string[]) => { const handleDelete = async (ids: string[]) => {
try { try {

View File

@@ -0,0 +1,103 @@
<template>
<el-dialog
title="班主任查看情况统计"
v-model="visible"
:close-on-click-modal="false"
width="900px"
draggable
>
<el-table
:data="dataList"
v-loading="loading"
stripe
style="width: 100%"
>
<el-table-column type="index" label="序号" width="70" align="center" />
<el-table-column prop="deptName" label="学院" min-width="120" align="center" />
<el-table-column prop="classNo" label="班号" min-width="100" align="center" />
<el-table-column prop="className" label="班级名称" min-width="160" align="center" />
<el-table-column prop="teacherRealName" label="班主任" min-width="120" align="center" />
<el-table-column label="是否查看" width="110" align="center">
<template #default="scope">
<el-tag
:type="scope.row.hasRead ? 'success' : 'info'"
effect="plain"
size="small"
>
{{ scope.row.hasRead ? '已查看' : '未查看' }}
</el-tag>
</template>
</el-table-column>
<el-table-column prop="readTime" label="查看时间" min-width="180" align="center" />
</el-table>
<template #footer>
<span class="dialog-footer">
<el-button @click="visible = false"> </el-button>
</span>
</template>
</el-dialog>
</template>
<script setup lang="ts" name="WeekPlanReadStatisticsDialog">
import { ref } from 'vue'
import { useMessage } from '/@/hooks/message'
import { readStatistics } from '/@/api/stuwork/weekplan'
import { useUserInfo } from '/@/stores/userInfo'
const visible = ref(false)
const loading = ref(false)
const dataList = ref<any[]>([])
const openDialog = async (weekPlanId: string) => {
if (!weekPlanId) {
useMessage().warning('未获取到每周工作ID')
return
}
visible.value = true
dataList.value = []
await fetchData(weekPlanId)
}
const fetchData = async (weekPlanId: string) => {
try {
loading.value = true
const userStore = useUserInfo()
const deptCode =
(userStore.userInfos as any)?.user?.deptCode ||
(userStore.userInfos as any)?.user?.deptCodeList?.[0] ||
''
if (!deptCode) {
useMessage().error('未获取到部门编码,无法统计班主任查看情况')
return
}
const res: any = await readStatistics({
deptCode,
weekPlanId,
})
if (Array.isArray(res?.data)) {
dataList.value = res.data
} else if (Array.isArray(res?.data?.data)) {
dataList.value = res.data.data
} else {
dataList.value = []
}
} catch (err: any) {
if (!err?._messageShown) {
useMessage().error(err?.msg || '统计班主任查看情况失败')
}
} finally {
loading.value = false
}
}
defineExpose({
openDialog,
})
</script>
<style scoped lang="scss">
</style>