修改功能bug

This commit is contained in:
yangjun 2024-08-02 10:55:54 +08:00
parent 0c9620c177
commit a827bca4d2
9 changed files with 303 additions and 16 deletions

View File

@ -86,6 +86,14 @@ const stuzy: AppRouteModule = {
title: '作业互评',
},
},
{
path: 'zyhpDetail',
name: 'zyhpDetail',
component: () => import('/@/views/zy/zyInfoStudentHp/ZyInfoStudentHpMyhpfsDetailList.vue'),
meta: {
title: '作业互评结果',
},
},
]
}

View File

@ -30,18 +30,19 @@
<!-- <div style="font-size: 18px;font-weight: bold;" class="ellipsis">{{item.title}}</div> -->
<div style="font-size: 18px; font-weight: bold">{{ item.title }}</div>
</a-col>
<a-col :span="24" class="zyCon">开始时间{{ dayjs(item.startTime).format('YYYY.MM.DD HH:mm') }}</a-col>
<a-col :span="24" class="zyCon">结束时间{{ dayjs(item.endTime).format('YYYY.MM.DD HH:mm') }}</a-col>
<a-col :span="24" class="zyCon">作业时间{{ dayjs(item.startTime).format('YYYY.MM.DD HH:mm') }} ~ {{ dayjs(item.endTime).format('YYYY.MM.DD HH:mm') }}</a-col>
<a-col :span="24" class="zyCon">互评时间<span v-if="item.xshpkg == '1'">{{ dayjs(item.endTime).format('YYYY.MM.DD HH:mm') }} ~ {{ dayjs(item.endTime).format('YYYY.MM.DD HH:mm') }}</span><span v-else>未设置互评</span></a-col>
<a-col :span="24" class="zyCon">
<div style="float: left">评分{{ item.stuscore ? item.stuscore : '未评' }}</div>
<div style="float: left">作业评分{{ item.zzdf ? item.zzdf : item.stuscore ? item.stuscore : '未评' }}</div>
<div style="float: right" class="wpopen" v-if="handleSfkshp(item)" @click="handleHpfs(item)">互评分数:{{ item.xshpfs ? item.xshpfs : '未评' }}</div>
</a-col>
<a-col :span="24" class="zyCon">
<div style="float: left" class="wpopen" :title="item.wwsftg" @click="handleOpenCcjg(item, '0')">网络查重:{{ getCctype(item, '1') }}</div>
<div style="float: right" class="wpopen" :title="item.nwsftg" @click="handleOpenCcjg(item, '1')">作业查重:{{ getCctype(item, '2') }}</div>
<div style="float: left" class="wpopen" :title="item.wwsftg" @click="handleOpenCcjg(item, '0')">维普资源库查重:{{ getCctype(item, '1') }}</div>
<div style="float: right" class="wpopen" :title="item.nwsftg" @click="handleOpenCcjg(item, '1')">本次作业查重:{{ getCctype(item, '2') }}</div>
</a-col>
<a-col :span="24" class="zyCon">
<div style="float: left" class="wpopen" :title="item.aigcsftg" @click="handleOpenCcjg(item, '2')">Aigc查重:{{ getCctype(item, '3') }}</div>
<div style="float: right" class="wpopen" :title="item.xnsftg" @click="handleOpenCcjg(item, '3')">校内查重:{{ getCctype(item, '4') }}</div>
<div style="float: left" class="wpopen" :title="item.xnsftg" @click="handleOpenCcjg(item, '3')">学校作业库查重:{{ getCctype(item, '4') }}</div>
<div style="float: right" class="wpopen" :title="item.aigcsftg" @click="handleOpenCcjg(item, '2')">Aigc查重:{{ getCctype(item, '3') }}</div>
</a-col>
<a-col :span="24" style="text-align: center; margin-top: 20px">
<a-button type="primary" @click="handleDetail(item)" style="margin-left: 5px; background: rgb(28, 132, 198)">详情</a-button>
@ -131,6 +132,11 @@ const wrapperCol = reactive({
sm: { span: 16 },
});
function handleHpfs(record){
var href = '/stuzy/zyhpDetail';
router.push({ path: href, query: { rwbh, xqxn, type, teano, zyStuId: record.stuId, mainId: record.id } });
}
function handleOpenCcjg(record, type) {
var text = "0";
if (type == '0') {
@ -178,7 +184,7 @@ function handleSfkshp(record) {
var xshpkssj = new Date(record.xshpkssj);
var xshpjssj = new Date(record.xshpjssj);
var nowTime = new Date();
if (sfkshp == '1' && nowTime.getTime() >= xshpkssj.getTime() && nowTime.getTime() <= xshpjssj.getTime()) {
if (record.stuFilePath && sfkshp == '1' && nowTime.getTime() >= xshpkssj.getTime() && nowTime.getTime() <= xshpjssj.getTime()) {
return true;
}
return false;

View File

@ -961,6 +961,17 @@ async function submitForm() {
}
}
if(xshpkssj && startTime){
var endTimestamp = Date.parse(xshpkssj);
var startTimestamp = Date.parse(startTime);
if (endTimestamp < startTimestamp) {
createMessage.warning('互评开始间不能小于作业发布时间!');
confirmLoading.value = false;
return;
}
}
await saveOrUpdate(model, isUpdate.value)
.then((res) => {
if (res.success) {

View File

@ -31,7 +31,8 @@ export const columnsZyhp: BasicColumn[] = [
{
title: '学生姓名',
align: "center",
dataIndex: 'studentName'
dataIndex: 'studentName',
slots: { customRender: 'stuNameSlot' },
},
{
title: '作业预览',
@ -50,7 +51,8 @@ export const columnsZyhpYhp: BasicColumn[] = [
{
title: '学生姓名',
align: "center",
dataIndex: 'studentName'
dataIndex: 'studentName',
slots: { customRender: 'stuNameSlot' },
},
{
title: '作业预览',

View File

@ -1,7 +1,8 @@
<template>
<!-- <div style="height: calc(100% - 87px);overflow-y: auto;"> -->
<div>
<!--查询区域-->
<div class="jeecg-basic-table-form-container">
<div class="jeecg-basic-table-form-con tainer">
<a-form @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-row :gutter="24">
<a-col :lg="8" :sm="24">
@ -33,6 +34,9 @@
<template #htmlSlot="{ text }">
<div v-html="text"></div>
</template>
<template #stuNameSlot="{ text }">
匿名
</template>
<template #sfpfSlot="{ text }">
<div v-if="text == '0'"></div>
<div v-if="text == '1'"></div>

View File

@ -0,0 +1,246 @@
<template>
<div>
<div style="width:100%;text-align: right;">
<a-button type="primary" @click="handleback">返回</a-button>
<a-button type="primary" @click="handleZyxxDetail" style="margin-left: 8px;;">作业信息</a-button></div>
<!--引用表格-->
<BasicTable @register="registerTable">
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" />
</template>
<!--字段回显插槽-->
<template #htmlSlot="{ text }">
<div v-html="text"></div>
</template>
<template #sfpfSlot="{ text }">
<div v-if="text == '0'"></div>
<div v-if="text == '1'"></div>
</template>
<template #stuNameSlot="{ text }">
匿名
</template>
<!--省市区字段回显插槽-->
<!--<template #pcaSlot="{text}">
{{ getAreaTextByCode(text) }}
</template>-->
<template #fileSlot="{ text }">
<span v-if="!text" style="font-size: 12px; font-style: italic">无文件</span>
<a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">下载</a-button>
</template>
</BasicTable>
<!-- 表单区域 -->
<ZyInfoStudentHpModal ref="registerModal" @success="handleSuccess"></ZyInfoStudentHpModal>
<ZyInfoDetailModal ref="registerZyxxModal" @success="handleSuccess"></ZyInfoDetailModal>
<ZyInfoStudentHpOneModal ref="registerOneModal" @success="handleSuccess"></ZyInfoStudentHpOneModal>
</div>
</template>
<script lang="ts" name="zyInfoStudentHp-zyInfoStudentHp" setup>
import { ref, reactive, unref,defineExpose } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns, columnsZyhp } from './ZyInfoStudentHp.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl, getHpxxYpyList } from './ZyInfoStudentHp.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import ZyInfoStudentHpModal from './components/ZyInfoStudentHpModal.vue';
import ZyInfoDetailModal from '/@/views/zy/zyInfo/components/ZyInfoDetailModal.vue';
import ZyInfoStudentHpOneModal from '/@/views/zy/zyInfoStudentHp/components/ZyInfoStudentHpOneModal.vue';
import { defHttp } from '/@/utils/http/axios';
import { JInput } from '/@/components/Form';
import { useRouter } from 'vue-router';
//
const { currentRoute } = useRouter();
const { query } = unref(currentRoute);
const { rwbh, xqxn, type, teano ,mainId,zyStuId} = query; //
const toggleSearchStatus = ref<boolean>(false);
const queryParam = ref<any>({rwbh,zyStuId});
let router = useRouter();
const registerModal = ref();
const registerZyxxModal = ref();
const registerOneModal = ref();
//table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
api: list,
columns: columns,
canResize: false,
useSearchForm: false,
showActionColumn: false,
actionColumn: {
width: 120,
fixed: 'right',
},
beforeFetch: (params) => {
(params.column = ''), (params.order = ''); //
return Object.assign(params, queryParam.value);
},
},
exportConfig: {
name: '学生成绩互评',
url: getExportUrl,
},
importConfig: {
url: getImportUrl,
success: handleSuccess,
},
});
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] =
tableContext;
const labelCol = reactive({
xs: { span: 24 },
sm: { span: 7 },
});
const wrapperCol = reactive({
xs: { span: 24 },
sm: { span: 16 },
});
function handleback(){
var href = "/stuzy/studentDqzy";
router.push({path:href,query: {rwbh,xqxn,type,teano}});
}
/**
* 新增事件
*/
function handleAdd() {
registerModal.value.disableSubmit = false;
registerModal.value.add();
}
/**
* 编辑事件
*/
function handleEdit(record: Recordable) {
registerModal.value.disableSubmit = false;
registerModal.value.edit(record);
}
/**
* 详情
*/
function handleDetail(record: Recordable) {
registerModal.value.disableSubmit = true;
registerModal.value.edit(record);
}
function handleOneScore(record: Recordable) {
record.zyStuId = record.id;
record.rwbh = record.rwbh;
registerOneModal.value.disableSubmit = false;
registerOneModal.value.edit(record);
}
/**
* 删除事件
*/
async function handleDelete(record) {
await deleteOne({ id: record.id }, handleSuccess);
}
/**
* 批量删除事件
*/
async function batchHandleDelete() {
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
}
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
function handleZyxxDetail(record: Recordable) {
defHttp.get({ url: '/zyInfo/zyInfo/queryById', params: { id: mainId } }).then((res) => {
console.log('😒', res);
registerZyxxModal.value.disableSubmit = true;
registerZyxxModal.value.edit(res);
});
}
/**
* 操作栏
*/
function getTableAction(record) {
if(record.sfpf == '0'){
return [
{
label: '作业信息',
onClick: handleZyxxDetail.bind(null, record),
},
{
label: '评分',
onClick: handleOneScore.bind(null, record),
},
];
}else{
return [
{
label: '作业信息',
onClick: handleZyxxDetail.bind(null, record),
},
];
}
}
/**
* 下拉操作栏
*/
function getDropDownAction(record) {
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
},
{
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
},
},
];
}
/**
* 查询
*/
function searchQuery() {
reload();
}
/**
* 重置
*/
function searchReset() {
queryParam.value = {};
selectedRowKeys.value = [];
//
reload();
}
defineExpose({
reload
});
</script>
<style lang="less" scoped>
.jeecg-basic-table-form-container {
.table-page-search-submitButtons {
display: block;
margin-bottom: 24px;
white-space: nowrap;
}
.query-group-cust {
width: calc(50% - 15px);
min-width: 100px !important;
}
.query-group-split-cust {
width: 30px;
display: inline-block;
text-align: center;
}
}
</style>

View File

@ -37,6 +37,9 @@
<div v-if="text == '0'"></div>
<div v-if="text == '1'"></div>
</template>
<template #stuNameSlot="{ text }">
匿名
</template>
<!--省市区字段回显插槽-->
<!--<template #pcaSlot="{text}">
{{ getAreaTextByCode(text) }}

View File

@ -1,5 +1,5 @@
<template>
<div style="background: #fff; height: 97%; margin: 10px 0;padding:10px;">
<div style="background: #fff; margin: 10px 0;padding:10px;">
<div style="text-align: right;width:100%;"><a-button type="primary" @click="handleback">返回</a-button></div>
<a-tabs v-model:activeKey="activeKey" @change="handleChange">
<a-tab-pane key="1" tab="待互评">

View File

@ -9,10 +9,12 @@
</a-col>
<a-col :span="24">
<a-form-item label="评分" v-bind="validateInfos.stuScore">
<div style="width: 100%; padding: 5px 10px; font-size: 14px; color: darkgrey">说明评分范围0-100之间;</div>
<a-input-number
v-model:value="formData.stuScore"
placeholder="请输入评分"
:min="1"
:min="0"
:max="100"
style="width: 300px"
:disabled="disabled"
@change="handleScoreChange"
@ -71,9 +73,9 @@ const disabled = computed(() => {
});
function handleScoreChange(record) {
console.log('😟', record);
if(record && parseInt(record) > 100){
formData.stuScore = 100
console.log('😥', record);
if (record && parseInt(record) > 100) {
formData.stuScore = '';
createMessage.error('请输入正确的分数');
}
}
@ -119,6 +121,11 @@ async function submitForm() {
}
}
}
if (!model.stuScore) {
createMessage.warning('分数为空,请输入正确的评分');
confirmLoading.value = false;
return;
}
console.log('👚', model);
await saveOne(model, isUpdate.value)
.then((res) => {