dbsd_kczx/src/views/zy/zyInfo/StudentZyInfoLiebiaoList.vue

388 lines
12 KiB
Vue
Raw Normal View History

2024-07-23 15:24:38 +08:00
<template>
2024-08-01 08:35:49 +08:00
<div style="margin-top: 20px">
2024-07-23 15:24:38 +08:00
<!--查询区域-->
<div class="jeecg-basic-table-form-container">
<!-- <a-form @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-row :gutter="24">
<a-col :lg="8">
<a-form-item label="作业名称">
<j-input placeholder="请输入作业名称" v-model:value="queryParam.title"></j-input>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
<a-col :lg="6">
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
</a-col>
</span>
</a-col>
</a-row>
</a-form> -->
</div>
<!--引用表格-->
2024-08-01 08:35:49 +08:00
<BasicTable @register="registerTable" style="margin-top: -20px">
2024-07-23 15:24:38 +08:00
<!--操作栏-->
<template #action="{ record }">
2024-08-01 08:35:49 +08:00
<TableAction :actions="getTableAction(record)" />
2024-07-23 15:24:38 +08:00
</template>
<!--字段回显插槽-->
2024-08-01 08:35:49 +08:00
<template #htmlSlot="{ text }">
2024-07-23 15:24:38 +08:00
<div v-html="text"></div>
</template>
<!--省市区字段回显插槽-->
2024-08-08 22:11:15 +08:00
<template #zzdfaction="{ text, record }">
<a-popover title="得分情况">
<template #content>
<p>作业得分{{ record.stuscore&&item.scoreFabu=='1' ? record.stuscore : '未评' }}</p>
<p v-if="record.jxfs">互评奖励{{ record.jxfs&&item.scoreFabu=='1' ? record.jxfs : '未评' }}</p>
2024-07-23 15:24:38 +08:00
</template>
2024-08-08 22:11:15 +08:00
<div class="Score-List-row">
<span class="List-row-number">{{ record.zzdf&&item.scoreFabu=='1' ? record.zzdf : '未评' }}</span>
</div>
</a-popover>
2024-07-23 15:24:38 +08:00
</template>
2024-08-08 22:11:15 +08:00
<template #zgcclgaction="{ text, record }">
<a-popover title="查重情况">
<template #content>
<a-row style="width:350px;">
<a-col :span="12">
<span class="zyCon-word">维普资源库查重</span>{{ getCctype(record, '1') }}
</a-col>
<a-col :span="12">
<span class="zyCon-word">本次作业查重</span>{{ getCctype(record, '2') }}
</a-col>
<a-col :span="12">
<span class="zyCon-word">学校作业库查重</span>{{ getCctype(record, '4') }}
</a-col>
<a-col :span="12">
<span class="zyCon-word">Aigc查重</span>{{ getCctype(record, '3') }}
</a-col>
</a-row>
2024-07-23 15:24:38 +08:00
</template>
2024-08-08 22:11:15 +08:00
<div class="Score-List-row">
<span class="List-row-number">{{ record.zgccl&&record.zgccl!='0'?record.zgccl:'-' }}</span>
</div>
</a-popover>
2024-07-23 15:24:38 +08:00
</template>
</BasicTable>
<!-- 表单区域 -->
<ZyInfoDetailModal ref="registerModal" @success="handleSuccess"></ZyInfoDetailModal>
<ZyInfoStudentListModal ref="ZyInfoStudentListModalPage"></ZyInfoStudentListModal>
<ZyInfoStudentModal ref="ZyInfoStudentModalPage" @success="handleSuccess"></ZyInfoStudentModal>
<XxhbbksListModal ref="XxhbbksListModalPage"></XxhbbksListModal>
</div>
</template>
<script lang="ts" name="zyInfoStudent-zyInfoStudent" setup>
2024-08-01 08:35:49 +08:00
import { ref, reactive, defineExpose, unref } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columnsStu } from '/@/views/zy/zyInfoStudent/ZyInfoStudent.data';
import { stuList, deleteOne, batchDelete, getImportUrl, getExportUrl, batchFabu } from '/@/views/zy/zyInfoStudent/ZyInfoStudent.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
// import ZyInfoStudentModal from '/@/views/zy/zyInfoStudent/components/ZyInfoStudentModal.vue'
// import SzybStudentModal from '/@/views/zy/zyInfoStudent/components/SzybStudentModal.vue';
// import ZyInfoStudentScoreModal from '/@/views/zy/zyInfoStudent/components/ZyInfoStudentScoreModal.vue'
import ZyInfoDetailModal from './components/ZyInfoDetailModal.vue';
import ZyInfoStudentListModal from '/@/views/zy/zyInfoStudent/ZyInfoStudentListModal.vue';
import ZyInfoStudentModal from '/@/views/zy/zyInfoStudent/components/ZyInfoStudentModal.vue';
import XxhbbksListModal from '/@/views/kc/xxhbbks/XxhbbksListModal.vue';
import { useGlobSetting } from '/@/hooks/setting';
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from '/@/hooks/web/useMessage';
import { JInput } from '/@/components/Form';
import { useRouter } from 'vue-router';
const { currentRoute } = useRouter();
const { query } = unref(currentRoute);
const { rwbh, xqxn, type, teano } = query; //获取传递参数
const { createMessage } = useMessage();
const globSetting = useGlobSetting();
const baseApiUrl = globSetting.domainUrl;
const queryParam = ref<any>({ rwbh, xqxn, teano, zyStatus: '1,2,3,4' });
const mainId = ref<string>('');
const toggleSearchStatus = ref<boolean>(false);
// const registerModal = ref();
// const registerScoreModal = ref();
// const SzybStudentModalpage = ref();
const registerModal = ref();
const ZyInfoStudentListModalPage = ref();
const ZyInfoStudentModalPage = ref();
const XxhbbksListModalPage = ref();
//注册table数据
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
api: stuList,
columns: columnsStu,
canResize: false,
useSearchForm: false,
actionColumn: {
width: '150px',
fixed: 'right',
2024-07-23 15:24:38 +08:00
},
2024-08-01 08:35:49 +08:00
showTableSetting: true,
defSort: {
field: 'name',
order: 'ascend',
2024-07-23 15:24:38 +08:00
},
2024-08-01 08:35:49 +08:00
beforeFetch: (params) => {
(params.column = 'createTime'), (params.order = 'desc'); //新生成的默认不带排序
return Object.assign(params, queryParam.value);
},
},
exportConfig: {
name: '学生作业信息',
url: getExportUrl,
params: () => {
return Object.assign({}, queryParam.value);
},
},
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 handleDetail(record: Recordable) {
registerModal.value.disableSubmit = true;
registerModal.value.edit(record);
}
2024-07-23 15:24:38 +08:00
2024-08-08 22:11:15 +08:00
function getCctype(record, type) {
var text = '-';
if (type == '1') {
if (record.wwcc == 'true') {
if (record.wwxsl) {
text = record.wwxsl + '%';
} else if (record.wwsftg && record.wwsftg.indexOf('失败') != -1) {
text = '失败';
} else if (record.stuFilePath) {
text = '检测中';
} else {
text = '待提交';
}
} else {
text = '不查重';
}
} else if (type == '2') {
if (record.nwcc == 'true') {
if (record.nwxsl) {
text = record.nwxsl + '%';
} else if (record.nwsftg && record.nwsftg.indexOf('失败') != -1) {
text = '失败';
} else if (record.stuFilePath) {
text = '检测中';
} else {
text = '待提交';
}
} else {
text = '不查重';
}
} else if (type == '3') {
if (record.aigccc == 'true') {
if (record.aigcxsl) {
text = record.aigcxsl + '%';
} else if (record.aigcsftg && record.aigcsftg.indexOf('失败') != -1) {
text = '失败';
} else if (record.stuFilePath) {
text = '检测中';
} else {
text = '待提交';
}
} else {
text = '不查重';
}
} else if (type == '4') {
if (record.xncc == 'true') {
if (record.xnxsl) {
text = record.xnxsl + '%';
} else if (record.xnsftg && record.xnsftg.indexOf('失败') != -1) {
text = '失败';
} else if (record.stuFilePath) {
text = '检测中';
} else {
text = '待提交';
}
} else {
text = '不查重';
}
}
return text;
}
2024-08-01 08:35:49 +08:00
//上传作业附件
function handleShangchuan(record) {
let timestamp = new Date().getTime();
let startTimestamp = Date.parse(record.startTime);
if (timestamp < startTimestamp) {
createMessage.error('还未到提交作业时间!');
return;
2024-07-23 15:24:38 +08:00
}
2024-08-01 08:35:49 +08:00
let endTimestamp = Date.parse(record.endTime + ' 23:59:59');
if (timestamp > endTimestamp) {
createMessage.error('提交作业时间已过!');
return;
2024-07-23 15:24:38 +08:00
}
2024-08-01 08:35:49 +08:00
ZyInfoStudentModalPage.value.disableSubmit = false;
var param = { id: record.stuId, zyfj: record.filePath };
ZyInfoStudentModalPage.value.edit(param);
// createConfirm({
// iconType: 'warning',
// title: '确认上传',
// content: '作业上传后,不可修改,请仔细检查后提交',
// okText: '确认',
// cancelText: '取消',
// onOk: () => {
// ZyInfoStudentModalPage.value.disableSubmit = false;
// var param = {id:record.stuId,zyfj:record.filePath}
// ZyInfoStudentModalPage.value.edit(param);
// }
// });
}
2024-07-23 15:24:38 +08:00
2024-08-01 08:35:49 +08:00
//预览
function handlePreview(record) {
var url2 = getFileAccessHttpUrl(record.stuPdfPath);
let url = baseApiUrl + '/generic/web/viewer.html?file=' + encodeURIComponent(url2);
window.open(url, '_blank');
}
2024-07-23 15:24:38 +08:00
2024-08-01 08:35:49 +08:00
function handleDownload(record) {
downloadFile(record.stuFilePath);
2024-07-23 15:24:38 +08:00
}
2024-08-01 08:35:49 +08:00
/**
* 成功回调
*/
function handleSuccess() {
selectedRowKeys.value = [];
reload();
}
2024-07-23 15:24:38 +08:00
2024-08-01 08:35:49 +08:00
function handleDown(text) {
downloadFile(text);
}
2024-07-23 15:24:38 +08:00
2024-08-01 08:35:49 +08:00
/**
* 操作栏
*/
function getTableAction(record) {
console.log('👎', record);
// <a-button type="primary" @click="handleDetail(item)" style="margin-left:5px;background:rgb(28, 132, 198);">详情</a-button>
// <a-button type="primary" @click="handleShangchuan(item)" style="margin-left:5px;background:rgb(28, 132, 198);" v-if="!item.stuFilePath">上传</a-button>
// <a-button type="primary" @click="handleDownload(item)" style="margin-left:5px;background:rgb(28, 132, 198);" v-if="item.stuFilePath">下载</a-button>
// <a-button type="primary" @click="handlePreview(item)" style="margin-left:5px;background:rgb(28, 132, 198);" v-if="item.stuFilePath">预览</a-button>
if (record.stuFilePath) {
var list = [
{
label: '详情',
onClick: handleDetail.bind(null, record),
},
{
label: '下载',
onClick: handleDownload.bind(null, record),
},
{
label: '预览',
onClick: handlePreview.bind(null, record),
},
];
return list;
} else {
var list = [
{
label: '详情',
onClick: handleDetail.bind(null, record),
},
{
label: '上传',
onClick: handleShangchuan.bind(null, record),
},
];
return list;
2024-07-23 15:24:38 +08:00
}
2024-08-01 08:35:49 +08:00
}
function handleYulan(text) {
window.open(text, '_blank');
}
2024-07-23 15:24:38 +08:00
2024-08-01 08:35:49 +08:00
/**
* 查询
*/
function searchQuery() {
selectedRowKeys.value = [];
reload();
}
2024-07-23 15:24:38 +08:00
2024-08-01 08:35:49 +08:00
/**
* 重置
*/
function searchReset() {
queryParam.value = {};
selectedRowKeys.value = [];
queryParam.value.mainId = mainId;
//刷新数据
reload();
}
2024-07-23 15:24:38 +08:00
2024-08-01 08:35:49 +08:00
function init(record) {
selectedRowKeys.value = [];
queryParam.value = {};
queryParam.value.mainId = record.id;
queryParam.value.queryType = record.queryType;
mainId.value = record.id;
reload();
}
2024-07-23 15:24:38 +08:00
2024-08-01 08:35:49 +08:00
defineExpose({
init,
});
2024-07-23 15:24:38 +08:00
</script>
<style lang="less" scoped>
2024-08-01 08:35:49 +08:00
.jeecg-basic-table-form-container {
.table-page-search-submitButtons {
display: block;
margin-bottom: 24px;
white-space: nowrap;
2024-07-23 15:24:38 +08:00
}
2024-08-01 08:35:49 +08:00
.query-group-cust {
width: calc(50% - 15px);
min-width: 100px !important;
}
.query-group-split-cust {
width: 30px;
display: inline-block;
text-align: center;
}
}
2024-07-23 15:24:38 +08:00
</style>