dbsd_kczx/src/views/kc/wjxCswj/WjxCswjList.vue

373 lines
14 KiB
Vue
Raw Normal View History

2024-05-06 08:11:00 +08:00
<template>
2024-05-24 20:43:23 +08:00
<div style="background: #fff;height: calc(100vh - 255px);overflow-y: auto;overflow-x: hidden;margin: 10px 0;">
2024-05-06 08:11:00 +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="7">
2024-05-21 17:53:16 +08:00
<a-form-item label="测验名称">
<a-input placeholder="请输入测验名称" v-model:value="queryParam.title"></a-input>
2024-05-06 08:11:00 +08:00
</a-form-item>
</a-col>
<a-col :lg="7">
2024-05-25 13:50:21 +08:00
<a-form-item label="测验状态">
<j-dict-select-tag placeholder="请选择测验状态" v-model:value="queryParam.qpublish" dictCode="zy_status"/>
2024-05-23 13:18:35 +08:00
<!-- <a-select placeholder="请选择问卷状态" ref="select" v-model:value="queryParam.qpublish">
<a-select-option value="">全部</a-select-option>
2024-05-21 17:53:16 +08:00
<a-select-option value="0">待发布</a-select-option>
<a-select-option value="1">已发布</a-select-option>
2024-05-23 13:18:35 +08:00
<a-select-option value="2">已完成</a-select-option>
</a-select> -->
</a-form-item>
</a-col>
2024-05-06 08:11:00 +08:00
<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>
2024-05-23 18:09:34 +08:00
<!-- <a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset" style="margin-left: 8px">重置</a-button> -->
<a-button type="primary" preIcon="ant-design:plus-outlined" @click="handleAdd" style="margin-left: 8px">新增</a-button>
<a-button type="primary" @click="handleTiku('6')" style="margin-left: 8px">题库</a-button>
2024-05-06 08:11:00 +08:00
</a-col>
</span>
</a-col>
</a-row>
</a-form>
</div>
<a-row>
2024-05-23 17:30:43 +08:00
<a-col :span="8" v-for="(item, index) in tableData" :key="index" style="padding: 0px 0px 5px 5px;overflow:hidden;">
<div style="width: 100%; height: 20px; background-color: rgb(28, 132, 198);"></div>
2024-05-24 20:43:23 +08:00
<a-card style="height: 256px;border: 1px solid rgb(28, 132, 198);">
2024-05-23 13:18:35 +08:00
<div class="rotate" :style="classFun(item.qpublish)">{{item.qpublish_dictText}}</div>
<a-row style="top: -48px;position: relative;">
<a-col :span="24" style="margin-bottom: 10px;height:53px;overflow:hidden;">
<div style="font-size: 18px;font-weight: bold;">{{item.title}}</div>
</a-col>
<a-col :span="24" class="zyCon">
<a-row>
2024-05-24 20:43:23 +08:00
<a-col :span="24" class="zyCon">时间{{dayjs(item.startTime).format('YYYY.MM.DD')}} - {{dayjs(item.endTime).format('YYYY.MM.DD')}}</a-col>
</a-row>
</a-col>
<a-col :span="24" class="zyCon">
<a-row>
<a-col :span="12" class="zyCon">{{item.xqxn}}</a-col>
<a-col :span="12" class="zyCon"><div style="float:right;" @click="openXkrs(item)"><a>{{item.xkrs}}人选课</a></div></a-col>
</a-row>
</a-col>
<a-col :span="24" class="zyCon">
<a-row>
<a-col :span="12" class="zyCon"><div style="float:left;" @click="handleDjjgs(item,'0')" v-if="item.wwcrs>0"><a>未提交{{item.wwcrs}}</a></div></a-col>
<a-col :span="12" class="zyCon"><div style="float:right;" @click="handleDjjgs(item,'1')" v-if="item.ywcrs>0"><a>已提交{{item.ywcrs}}</a></div></a-col>
</a-row>
</a-col>
2024-05-24 20:43:23 +08:00
<a-col :span="24" style="text-align:center;margin-top:8px;">
<a-button type="primary" @click="handleEdit(item)" style="margin-left:5px;margin-bottom:5px;padding: 0px 4px;background:rgb(28, 132, 198);" v-if="item.qpublish==0">设置试卷</a-button>
<a-button type="primary" @click="handleFabu(item)" style="margin-left:5px;margin-bottom:5px;padding: 0px 4px;background:rgb(28, 132, 198);" v-if="item.qpublish==0">发布试卷</a-button>
<a-button type="primary" @click="handleDelete(item)" style="margin-left:5px;margin-bottom:5px;padding: 0px 4px;background:rgb(28, 132, 198);" v-if="item.qpublish==0">删除试卷</a-button>
2024-05-28 09:10:23 +08:00
<a-button type="primary" @click="handlePeizhi(item)" style="margin-left:5px;margin-bottom:5px;padding: 0px 4px;background:rgb(28, 132, 198);" v-if="item.qpublish==0">编辑题目</a-button>
<a-button type="primary" @click="handlePeizhiXq(item)" style="margin-left:5px;margin-bottom:5px;padding: 0px 4px;background:rgb(28, 132, 198);" v-if="item.qpublish==0">预览题目</a-button>
2024-05-25 12:45:53 +08:00
<a-button type="primary" @click="handleDetail(item)" style="margin-left:5px;margin-bottom:5px;padding: 0px 4px;background:rgb(28, 132, 198);" v-if="item.qpublish==1||item.qpublish==2">试卷详情</a-button>
<a-button type="primary" @click="handlePeizhiXq(item)" style="margin-left:5px;margin-bottom:5px;padding: 0px 4px;background:rgb(28, 132, 198);" v-if="item.qpublish==1||item.qpublish==2">预览题目</a-button>
<a-button type="primary" @click="handleDjjgs(item,'')" style="margin-left:5px;margin-bottom:5px;padding: 0px 4px;background:rgb(28, 132, 198);" v-if="item.qpublish==1||item.qpublish==2">测验结果</a-button>
</a-col>
<!-- <a-col :span="24" style="text-align:center;margin-top:20px;">-->
<!-- <a-button type="primary" @click="handleDj(item)" style="margin-left:5px;padding: 0px 8px;background:rgb(28, 132, 198);" v-if="item.qpublish==1">答卷</a-button>-->
<!-- <a-button type="primary" @click="handleDjjg(item)" style="margin-left:5px;padding: 0px 8px;background:rgb(28, 132, 198);" v-if="item.qpublish==1">查看答卷</a-button>-->
<!-- </a-col>-->
</a-row>
</a-card>
</a-col>
<a-col :span="24">
<div v-show="tableData.length>0">
<a-pagination v-model="current" :total="total" @change="handlePageChange" :pageSize="pageSize" style="text-align: right;"/>
</div>
<div v-show="tableData.length==0">
<a-empty/>
</div>
</a-col>
</a-row>
2024-05-06 08:11:00 +08:00
<!-- 表单区域 -->
<WjxWjxxModal ref="registerModal" @success="handleSuccess"></WjxWjxxModal>
<WjxWjxxTmlbModal ref="WjxWjxxTmlbModalPage" @success="handleSuccess"></WjxWjxxTmlbModal>
<WjxWjxxTmlbDjModal ref="WjxWjxxTmlbDjModalPage" @success="handleSuccess"></WjxWjxxTmlbDjModal>
<WjxWjxxTmlbDjjgsModal ref="WjxWjxxTmlbDjjgsModalPage" @success="handleSuccess"></WjxWjxxTmlbDjjgsModal>
<XxhbbksListModal ref="XxhbbksListModalPage"></XxhbbksListModal>
2024-05-23 18:09:34 +08:00
<TikuListModal ref="TikuListModalPage"></TikuListModal>
2024-05-06 08:11:00 +08:00
</div>
</template>
<script lang="ts" name="wjxWjxx-wjxWjxx" setup>
import {ref, reactive, defineExpose, unref, onMounted} from 'vue';
2024-05-06 08:11:00 +08:00
import { defHttp } from '/@/utils/http/axios';
import { Input, Popover, Pagination, Empty } from 'ant-design-vue';
import { list ,deleteOne } from '/@/views/kc/wjxWjxx/WjxWjxx.api';
2024-05-23 18:09:34 +08:00
import {useRouter} from "vue-router";
2024-05-23 13:18:35 +08:00
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import WjxWjxxModal from '/@/views/kc/wjxWjxx/components/WjxWjxxModal.vue'
2024-05-06 08:11:00 +08:00
import WjxWjxxTmlbModal from '/@/views/kc/wjxWjxx/components/WjxWjxxTmlbModal.vue'
import WjxWjxxTmlbDjModal from '/@/views/kc/wjxWjxx/components/WjxWjxxTmlbDjModal.vue'
import WjxWjxxTmlbDjjgsModal from '/@/views/kc/wjxWjxx/components/WjxWjxxTmlbDjjgsModal.vue'
import XxhbbksListModal from '/@/views/kc/xxhbbks/XxhbbksListModal.vue';
import {useMessage} from "/@/hooks/web/useMessage";
2024-05-23 18:09:34 +08:00
import TikuListModal from '/@/views/kc/wjxWjxxTmlb/TikuListModal.vue';
2024-05-24 20:43:23 +08:00
import dayjs from 'dayjs';
//当前路由信息
const { currentRoute } = useRouter();
const { query } = unref(currentRoute);
const { rwbh,xqxn,typa } = query;//获取传递参数
const { createConfirm } = useMessage();
const APagination = Pagination;
2024-05-06 08:11:00 +08:00
const queryParam = ref<any>({});
const current = ref<number>(0);
const total = ref<number>(0);
const pageNo = ref<number>(0);
const pageSize = ref<number>(6);
const tableData = ref<any>([]);
2024-05-06 08:11:00 +08:00
const registerModal = ref();
const WjxWjxxTmlbModalPage = ref();
const WjxWjxxTmlbDjModalPage = ref();
const WjxWjxxTmlbDjjgsModalPage = ref()
const WjxWjxxTmlbDjjgsDcModalPage = ref();
const XxhbbksListModalPage = ref();
2024-05-23 18:09:34 +08:00
const TikuListModalPage = ref();
2024-05-06 08:11:00 +08:00
const labelCol = reactive({
xs: { span: 24 },
sm: { span: 7 },
});
const wrapperCol = reactive({
xs: { span: 24 },
sm: { span: 16 },
});
2024-05-23 18:09:34 +08:00
//题库类型6作业1问卷
function handleTiku(wjLeixing){
var record = {wjLeixing}
TikuListModalPage.value.disableSubmit = true;
TikuListModalPage.value.init(record);
}
2024-05-06 08:11:00 +08:00
/**
* 新增事件
*/
function handleAdd() {
registerModal.value.disableSubmit = false;
registerModal.value.add("6");
2024-05-06 08:11:00 +08:00
}
2024-05-06 08:11:00 +08:00
/**
* 编辑事件
*/
function handleEdit(record: Recordable) {
registerModal.value.disableSubmit = false;
registerModal.value.edit(record);
}
/**
* 获取选课人数
*/
function openXkrs(record){
// console.log(`🚀 ~ openXkrs ~ record:`, record)
XxhbbksListModalPage.value.disableSubmit = true;
XxhbbksListModalPage.value.init(record);
}
/**
* 配置
*/
2024-05-06 08:11:00 +08:00
function handlePeizhi(record: Recordable) {
WjxWjxxTmlbModalPage.value.disableSubmit = false;
WjxWjxxTmlbModalPage.value.edit(record,"6");
2024-05-06 08:11:00 +08:00
}
/**
* 配置详情
*/
function handlePeizhiXq(record: Recordable) {
WjxWjxxTmlbDjModalPage.value.disableSubmit = true;
WjxWjxxTmlbDjModalPage.value.edit(record,true,"6",'ls');
}
// /**
// * 答卷详情
// */
// function handleDj(record: Recordable) {
// WjxWjxxTmlbDjModalPage.value.disableSubmit = false;
// WjxWjxxTmlbDjModalPage.value.edit(record,false);
// }
// /**
// * 答卷详情
// */
// function handleDjjg(record: Recordable) {
// WjxWjxxTmlbDjjgModalPage.value.disableSubmit = true;
// WjxWjxxTmlbDjjgModalPage.value.edit(record,false);
// }
/**
* 学生答卷列表
*/
function handleDjjgs(record: Recordable,flag) {
WjxWjxxTmlbDjjgsModalPage.value.disableSubmit = true;
WjxWjxxTmlbDjjgsModalPage.value.edit(record,flag);
}
2024-05-06 08:11:00 +08:00
/**
* 详情
*/
function handleDetail(record: Recordable) {
registerModal.value.disableSubmit = true;
registerModal.value.edit(record);
}
/**
* 发布
*/
2024-05-06 08:11:00 +08:00
function handleFabu(record: Recordable) {
2024-05-24 20:43:23 +08:00
createConfirm({
iconType: 'warning',
title: '发布测验',
content: '是否发布此测验?',
okText: '确认',
cancelText: '取消',
onOk: () => {
defHttp.get({ url: '/wjxWjxx/wjxWjxx/fbwj', params: { id: record.id,wjlx: "6" } }).then(res => {
handleSuccess();
});
}
2024-05-06 08:11:00 +08:00
});
}
/**
* 删除事件
*/
async function handleDelete(record) {
createConfirm({
iconType: 'warning',
title: '删除',
content: '是否删除此测验?',
okText: '确认',
cancelText: '取消',
onOk: () => {
deleteOne({ id: record.id }, handleSuccess2);
}
});
2024-05-06 08:11:00 +08:00
}
function reload(){
queryParam.value.pageNo = current.value;
queryParam.value.pageSize = pageSize.value;
queryParam.value.rwbh = rwbh;
queryParam.value.xqxn = xqxn;
queryParam.value.atype = "6";
defHttp.get({ url: '/wjxWjxx/wjxWjxx/list', params: queryParam.value }).then(res => {
// console.log(`🚀 ~ defHttp.get ~ res:`, res)
total.value = res.total;
pageNo.value = res.pages;
current.value = res.current;
tableData.value = res.records;
});
2024-05-06 08:11:00 +08:00
}
2024-05-06 08:11:00 +08:00
/**
* 成功回调,用于删除
2024-05-06 08:11:00 +08:00
*/
function handleSuccess2() {
total.value = 1;
handlePageChange(1);
2024-05-06 08:11:00 +08:00
}
/**
* 成功回调用于增加修改发布和撤回
*/
function handleSuccess() {
reload();
}
2024-05-06 08:11:00 +08:00
/**
* 查询
*/
function searchQuery() {
total.value = 1;
handlePageChange(1);
2024-05-06 08:11:00 +08:00
}
2024-05-06 08:11:00 +08:00
/**
* 重置
*/
function searchReset() {
queryParam.value = {};
total.value = 1;
handlePageChange(1);
2024-05-06 08:11:00 +08:00
}
function handlePageChange(record){
current.value = record;
reload();
2024-05-06 08:11:00 +08:00
}
onMounted(() => {
searchQuery();
2024-05-06 08:11:00 +08:00
});
function classFun(type){
if(type == '0'){
2024-05-23 18:09:34 +08:00
return "background: #fe1a1a";
}else if(type == '1'){
2024-05-23 18:09:34 +08:00
return "background: #c6c209";
2024-05-23 13:18:35 +08:00
}else if(type == '2'){
2024-05-23 18:09:34 +08:00
return "background: #18a689";
}
}
2024-05-06 08:11:00 +08:00
</script>
<style lang="less" scoped>
.jeecg-basic-table-form-container {
padding: 0;
2024-05-23 17:30:43 +08:00
width:99%;
2024-05-06 08:11:00 +08:00
.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
}
}
.jeecg-basic-table-form-container .ant-form {
padding: 12px 10px 0px 10px;
margin-bottom: 0px;
background-color: #fff;
border-radius: 2px;
}
.ellipsis {
overflow: hidden; /* 确保超出容器的内容被裁剪 */
white-space: nowrap; /* 确保文本在一行内显示 */
text-overflow: ellipsis; /* 超出部分显示省略号 */
}
.zyCon{
line-height: 30px;
}
.rotate {
transform: rotate(45deg);
background: rgb(28, 132, 198);
color: #fff;
padding: 19px 10px 3px 10px;
position: relative;
top: -54px;
right: -131px;
text-align: center;
font-size: 11px;
}
2024-05-06 08:11:00 +08:00
</style>