init
This commit is contained in:
14450
docs/默认模块.openapi.json
14450
docs/默认模块.openapi.json
File diff suppressed because it is too large
Load Diff
@@ -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({
|
||||
url: '/stuwork/weekPlan/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ export function addObj(obj?: Object) {
|
||||
return request({
|
||||
url: '/stuwork/weekPlan',
|
||||
method: 'post',
|
||||
data: obj
|
||||
data: obj,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ export function getObj(obj?: Object) {
|
||||
return request({
|
||||
url: '/stuwork/weekPlan/detail',
|
||||
method: 'get',
|
||||
params: obj
|
||||
params: obj,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ export function delObjs(ids?: Object) {
|
||||
return request({
|
||||
url: '/stuwork/weekPlan/delete',
|
||||
method: 'post',
|
||||
data: ids
|
||||
data: ids,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -61,7 +61,20 @@ export function putObj(obj?: Object) {
|
||||
return request({
|
||||
url: '/stuwork/weekPlan/edit',
|
||||
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 {Function} callback - 验证完成后的回调函数。
|
||||
* @param {boolean} isEdit - 当前操作是否为编辑。
|
||||
*
|
||||
*
|
||||
* 示例用法:
|
||||
* 字段名: [
|
||||
* {
|
||||
@@ -84,17 +97,16 @@ export function putObj(obj?: Object) {
|
||||
*/
|
||||
export function validateExist(rule: any, value: any, callback: any, isEdit: boolean) {
|
||||
if (isEdit) {
|
||||
return callback();
|
||||
return callback()
|
||||
}
|
||||
|
||||
getObj({ [rule.field]: value }).then((response) => {
|
||||
const result = response.data;
|
||||
getObj({ [rule.field]: value }).then(response => {
|
||||
const result = response.data
|
||||
if (result !== null && result.length > 0) {
|
||||
callback(new Error('数据已经存在'));
|
||||
callback(new Error('数据已经存在'))
|
||||
} else {
|
||||
callback();
|
||||
callback()
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -132,7 +132,7 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
<el-table-column label="操作" width="250" align="center" fixed="right">
|
||||
<el-table-column label="操作" width="360" align="center" fixed="right">
|
||||
<template #header>
|
||||
<el-icon><Setting /></el-icon>
|
||||
<span style="margin-left: 4px">操作</span>
|
||||
@@ -152,6 +152,13 @@
|
||||
@click="formDialogRef.openDialog(scope.row.id)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="Histogram"
|
||||
link
|
||||
type="success"
|
||||
@click="handleReadStatistics(scope.row)">
|
||||
查看班主任查看情况
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="Delete"
|
||||
link
|
||||
@@ -183,28 +190,32 @@
|
||||
|
||||
<!-- 详情对话框 -->
|
||||
<DetailDialog ref="detailDialogRef" @refresh="getDataList(false)" />
|
||||
<!-- 班主任查看情况统计 -->
|
||||
<ReadStatisticsDialog ref="readStatisticsDialogRef" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="WeekPlan">
|
||||
import { ref, reactive, defineAsyncComponent, onMounted, nextTick } from 'vue'
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table";
|
||||
import { fetchList, delObjs } from "/@/api/stuwork/weekplan";
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message";
|
||||
import { BasicTableProps, useTable } from '/@/hooks/table'
|
||||
import { fetchList, delObjs } from '/@/api/stuwork/weekplan'
|
||||
import { useMessage, useMessageBox } from '/@/hooks/message'
|
||||
import { queryAllSchoolYear } from '/@/api/basic/basicyear'
|
||||
import TableColumnControl from '/@/components/TableColumnControl/index.vue'
|
||||
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'
|
||||
import { useTableColumnControl } from '/@/hooks/tableColumn'
|
||||
|
||||
// 引入组件
|
||||
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
|
||||
const DetailDialog = defineAsyncComponent(() => import('./detail.vue'));
|
||||
const FormDialog = defineAsyncComponent(() => import('./form.vue'))
|
||||
const DetailDialog = defineAsyncComponent(() => import('./detail.vue'))
|
||||
const ReadStatisticsDialog = defineAsyncComponent(() => import('./readStatistics.vue'))
|
||||
|
||||
// 定义变量内容
|
||||
const formDialogRef = ref()
|
||||
const detailDialogRef = ref()
|
||||
const readStatisticsDialogRef = ref()
|
||||
const searchFormRef = ref()
|
||||
const columnControlRef = ref<any>()
|
||||
// 搜索变量
|
||||
@@ -261,7 +272,7 @@ const {
|
||||
sizeChangeHandle,
|
||||
sortChangeHandle,
|
||||
downBlobFile,
|
||||
tableStyle
|
||||
tableStyle,
|
||||
} = useTable(state)
|
||||
|
||||
// 查询
|
||||
@@ -293,6 +304,16 @@ const handleViewDetail = async (id: string) => {
|
||||
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[]) => {
|
||||
try {
|
||||
|
||||
103
src/views/stuwork/weekplan/readStatistics.vue
Normal file
103
src/views/stuwork/weekplan/readStatistics.vue
Normal 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>
|
||||
|
||||
Reference in New Issue
Block a user