dbsd_kczx/src/views/zy/zyInfoStudent/ZyInfoStudentList.vue

387 lines
12 KiB
Vue
Raw Normal View History

2024-05-06 19:41:47 +08:00
<template>
<div>
<!--查询区域-->
2024-05-07 17:14:14 +08:00
<!-- <div class="jeecg-basic-table-form-container">
2024-05-06 19:41:47 +08:00
<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="作业名称">
<a-input placeholder="请输入作业名称" v-model:value="queryParam.mainId"></a-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">
2024-05-07 17:14:14 +08:00
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">刷新</a-button>
2024-05-06 19:41:47 +08:00
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset" style="margin-left: 8px">重置</a-button>
</a-col>
</span>
</a-col>
</a-row>
</a-form>
2024-05-07 17:14:14 +08:00
</div> -->
2024-05-06 19:41:47 +08:00
<!--引用表格-->
2024-05-21 17:53:16 +08:00
<BasicTable @register="registerTable" style="margin-top: 20px;">
2024-05-28 09:10:23 +08:00
<template #tableTitle>
<span>检测时间提醒 非高峰期预计30分钟内返回检测结果高峰期预计时间会更长请您耐心等待</span>
</template>
2024-05-06 19:41:47 +08:00
<!--操作栏-->
<template #action="{ record }">
2024-05-28 09:10:23 +08:00
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
2024-05-06 19:41:47 +08:00
</template>
<!--字段回显插槽-->
<template #htmlSlot="{text}">
<div v-html="text"></div>
</template>
<!--省市区字段回显插槽-->
2024-05-23 21:06:35 +08:00
2024-05-21 17:53:16 +08:00
<template #wwsftgaction="{text,record}">
<span v-if="record.wwcc=='0'">-</span>
<span v-else>
2024-05-23 21:06:35 +08:00
<span v-if="text=='通过'" style="color: green;padding: 5px 15px;" title="通过">{{record.wwxsl}}%</span>
<span v-else-if="text=='未通过'" style="color: red;padding: 5px 15px;" title="未通过">{{record.wwxsl}}%</span>
2024-05-21 17:53:16 +08:00
<span v-else>
<span v-if="record.filePath">检测中</span>
<span v-else>未提交</span>
</span>
</span>
</template>
<template #nwsftgaction="{text,record}">
<span v-if="record.nwcc=='0'">-</span>
<span v-else>
2024-05-23 21:06:35 +08:00
<span v-if="text=='通过'" style="color: green;padding: 5px 15px;" title="通过">{{record.nwxsl}}%</span>
<span v-else-if="text=='未通过'" style="color: red;padding: 5px 15px;" title="未通过">{{record.nwxsl}}%</span>
2024-05-21 17:53:16 +08:00
<span v-else>
<span v-if="record.filePath">检测中</span>
<span v-else>未提交</span>
</span>
</span>
</template>
<template #aigcsftgaction="{text,record}">
<span v-if="record.aigccc=='0'">-</span>
<span v-else>
2024-05-23 21:06:35 +08:00
<span v-if="text=='通过'" style="color: green;padding: 5px 15px;" title="通过">{{record.aigcxsl}}%</span>
<span v-else-if="text=='未通过'" style="color: red;padding: 5px 15px;" title="未通过">{{record.aigcxsl}}%</span>
2024-05-21 17:53:16 +08:00
<span v-else>
<span v-if="record.filePath">检测中</span>
<span v-else>未提交</span>
</span>
</span>
</template>
2024-05-06 19:41:47 +08:00
<!--<template #pcaSlot="{text}">
{{ getAreaTextByCode(text) }}
</template>-->
2024-05-17 22:15:18 +08:00
<!-- <template #fileSlot="{text}">
2024-05-06 19:41:47 +08:00
<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>
2024-05-17 22:15:18 +08:00
</template> -->
<!-- <template #fileZxSlot="{text,record}">
2024-05-10 20:01:34 +08:00
<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="yulanFile(text)">预览</a-button>
2024-05-17 22:15:18 +08:00
</template> -->
2024-05-06 19:41:47 +08:00
</BasicTable>
<!-- 表单区域 -->
<ZyInfoStudentModal ref="registerModal" @success="handleSuccess"></ZyInfoStudentModal>
2024-05-13 16:29:57 +08:00
<ZyInfoStudentScoreModal ref="registerScoreModal" @success="handleSuccess"></ZyInfoStudentScoreModal>
2024-05-24 15:31:26 +08:00
<SzybStudentModal ref="SzybStudentModalpage" @success="handleSuccess"></SzybStudentModal>
2024-05-06 19:41:47 +08:00
</div>
</template>
<script lang="ts" name="zyInfoStudent-zyInfoStudent" setup>
2024-05-07 09:57:47 +08:00
import { ref, reactive,defineExpose } from 'vue';
2024-05-06 19:41:47 +08:00
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns } from './ZyInfoStudent.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './ZyInfoStudent.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import ZyInfoStudentModal from './components/ZyInfoStudentModal.vue'
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
2024-05-24 15:31:26 +08:00
import SzybStudentModal from '/@/views/zy/zyInfoStudent/components/SzybStudentModal.vue';
2024-05-23 21:06:35 +08:00
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
2024-05-13 16:29:57 +08:00
import ZyInfoStudentScoreModal from '/@/views/zy/zyInfoStudent/components/ZyInfoStudentScoreModal.vue'
2024-05-17 22:15:18 +08:00
import { useGlobSetting } from '/@/hooks/setting';
2024-05-22 13:43:18 +08:00
import { defHttp } from '/@/utils/http/axios';
2024-05-23 21:06:35 +08:00
import { useMessage } from '/@/hooks/web/useMessage';
const { createMessage } = useMessage();
2024-05-13 16:29:57 +08:00
2024-05-17 22:15:18 +08:00
const globSetting = useGlobSetting();
2024-05-23 21:06:35 +08:00
const baseApiUrl = globSetting.domainUrl;
2024-05-06 19:41:47 +08:00
const queryParam = ref<any>({});
2024-05-07 09:57:47 +08:00
const mainId = ref<string>('');
2024-05-23 21:06:35 +08:00
2024-05-06 19:41:47 +08:00
const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref();
2024-05-13 16:29:57 +08:00
const registerScoreModal = ref();
2024-05-24 15:31:26 +08:00
const SzybStudentModalpage = ref();
2024-05-06 19:41:47 +08:00
//注册table数据
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
api: list,
columns,
canResize:false,
useSearchForm: false,
actionColumn: {
2024-05-24 15:31:26 +08:00
width: '300px',
2024-05-21 17:53:16 +08:00
// fixed: 'right',
2024-05-06 19:41:47 +08:00
},
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 },
});
2024-05-17 22:15:18 +08:00
function yulanFile(record){
2024-05-10 20:01:34 +08:00
// let url = "https://view.officeapps.live.com/op/view.aspx?src="+encodeURIComponent(getFileAccessHttpUrl(text));
// let url = "https://view.officeapps.live.com/op/view.aspx?src="+encodeURIComponent(getFileAccessHttpUrl(text));
2024-05-17 22:15:18 +08:00
// let url = "https://view.xdocin.com/view?src="+encodeURIComponent('https://view.xdocin.com/demo/view.docx');
// window.open(url,"_blank")
2024-05-23 21:06:35 +08:00
2024-05-17 22:15:18 +08:00
var url2 = getFileAccessHttpUrl(record.pdfPath)
console.log(`🚀 ~ openPdf ~ url2:`, url2)
let url = baseApiUrl+"/generic/web/viewer.html?file="+encodeURIComponent(url2);
2024-05-10 20:01:34 +08:00
window.open(url,"_blank")
}
2024-05-06 19:41:47 +08:00
/**
* 新增事件
*/
function handleAdd() {
registerModal.value.disableSubmit = false;
registerModal.value.add();
}
2024-05-23 21:06:35 +08:00
2024-05-06 19:41:47 +08:00
/**
* 编辑事件
*/
function handleEdit(record: Recordable) {
registerModal.value.disableSubmit = false;
registerModal.value.edit(record);
}
2024-05-13 16:29:57 +08:00
function handleScore(record: Recordable) {
registerScoreModal.value.disableSubmit = false;
registerScoreModal.value.edit(record);
}
2024-05-22 18:26:41 +08:00
function handleBohui(record: Recordable){
defHttp.post({url:'/zyInfoStudent/zyInfoStudent/editBohui',params:{id:record.id}}).then(res =>{
handleSuccess()
})
}
2024-05-22 13:43:18 +08:00
function handleScoreFabu(record: Recordable){
2024-05-23 21:06:35 +08:00
//判断
if(!record.score){
createMessage.warn('请填写评分!');
return;
}
2024-05-22 13:43:18 +08:00
defHttp.post({url:'/zyInfoStudent/zyInfoStudent/editFabu',params:{id:record.id,scoreFabu:'1'}}).then(res =>{
handleSuccess()
})
}
2024-05-23 21:06:35 +08:00
2024-05-06 19:41:47 +08:00
/**
* 详情
*/
function handleDetail(record: Recordable) {
registerModal.value.disableSubmit = true;
registerModal.value.edit(record);
}
2024-05-23 21:06:35 +08:00
2024-05-24 15:31:26 +08:00
//存档类型
function handleSzyb(record: Recordable){
SzybStudentModalpage.value.disabled = false;
SzybStudentModalpage.value.edit(record);
}
2024-05-06 19:41:47 +08:00
/**
* 删除事件
*/
async function handleDelete(record) {
await deleteOne({ id: record.id }, handleSuccess);
}
2024-05-23 21:06:35 +08:00
2024-05-06 19:41:47 +08:00
/**
* 批量删除事件
*/
async function batchHandleDelete() {
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
}
2024-05-23 21:06:35 +08:00
2024-05-06 19:41:47 +08:00
/**
* 成功回调
*/
function handleSuccess() {
2024-05-07 17:14:14 +08:00
reload();
2024-05-06 19:41:47 +08:00
}
2024-05-13 16:29:57 +08:00
function handleDown(record){
2024-05-22 13:43:18 +08:00
downloadFile(record.filePath);
2024-05-13 16:29:57 +08:00
}
2024-05-23 21:06:35 +08:00
2024-05-06 19:41:47 +08:00
/**
* 操作栏
*/
function getTableAction(record) {
2024-05-13 16:29:57 +08:00
if(record.filePath){
2024-05-22 13:43:18 +08:00
if(record.scoreFabu=='1'){
2024-05-13 16:29:57 +08:00
var list = [
2024-05-28 09:10:23 +08:00
// {
// label: '详情',
// onClick: handleDetail.bind(null, record),
// },
2024-05-24 15:31:26 +08:00
{
label: '设置样本',
onClick: handleSzyb.bind(null, record),
},
{
label: '下载',
onClick: handleDown.bind(null, record),
},
{
label: '预览',
onClick: yulanFile.bind(null, record),
}
];
2024-05-13 16:29:57 +08:00
return list;
}else{
var list = [
2024-05-22 18:26:41 +08:00
{
label: '驳回',
onClick: handleBohui.bind(null, record),
},
2024-05-13 16:29:57 +08:00
{
label: '评分',
onClick: handleScore.bind(null, record),
},
2024-05-22 13:43:18 +08:00
{
label: '发布评分',
onClick: handleScoreFabu.bind(null, record),
},
2024-05-28 09:10:23 +08:00
// {
// label: '详情',
// onClick: handleDetail.bind(null, record),
// },
2024-05-13 16:29:57 +08:00
{
label: '下载',
onClick: handleDown.bind(null, record),
},
{
label: '预览',
onClick: yulanFile.bind(null, record),
}];
return list;
}
2024-05-23 21:06:35 +08:00
2024-05-13 16:29:57 +08:00
}else{
2024-05-28 09:10:23 +08:00
// var list = [
// {
// label: '详情',
// onClick: handleDetail.bind(null, record),
// },];
2024-05-13 16:29:57 +08:00
return list;
}
2024-05-23 21:06:35 +08:00
2024-05-06 19:41:47 +08:00
}
2024-05-23 21:06:35 +08:00
2024-05-06 19:41:47 +08:00
/**
* 下拉操作栏
*/
function getDropDownAction(record) {
return [
{
2024-05-28 09:10:23 +08:00
label: '外网结果下载',
2024-05-06 19:41:47 +08:00
onClick: handleDetail.bind(null, record),
2024-05-28 09:10:23 +08:00
},
{
label: '外网结果预览',
onClick: handleDetail.bind(null, record),
},
{
label: '内网结果下载',
onClick: handleDetail.bind(null, record),
},
{
label: '内网结果预览',
onClick: handleDetail.bind(null, record),
},
{
label: 'aigc结果下载',
onClick: handleDetail.bind(null, record),
},
{
label: 'aigc结果预览',
onClick: handleDetail.bind(null, record),
},
2024-05-06 19:41:47 +08:00
]
}
/**
* 查询
*/
function searchQuery() {
reload();
}
2024-05-23 21:06:35 +08:00
2024-05-06 19:41:47 +08:00
/**
* 重置
*/
function searchReset() {
queryParam.value = {};
selectedRowKeys.value = [];
2024-05-07 17:14:14 +08:00
queryParam.value.mainId = mainId;
2024-05-06 19:41:47 +08:00
//刷新数据
reload();
}
2024-05-23 21:06:35 +08:00
2024-05-07 09:57:47 +08:00
function init(record){
queryParam.value.mainId = record.id;
2024-05-07 17:14:14 +08:00
mainId.value = record.id;
reload();
2024-05-07 09:57:47 +08:00
}
2024-05-23 21:06:35 +08:00
2024-05-07 09:57:47 +08:00
defineExpose({
init,
});
2024-05-06 19:41:47 +08:00
</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>