211 lines
6.3 KiB
Vue
211 lines
6.3 KiB
Vue
<template>
|
|
<div style="margin-top:20px;">
|
|
<!--查询区域-->
|
|
<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">
|
|
<a-form-item label="测验名称">
|
|
<a-input placeholder="请输入测验名称" v-model:value="queryParam.title"></a-input>
|
|
</a-form-item>
|
|
</a-col>
|
|
<a-col :lg="7">
|
|
<a-form-item label="测验类型">
|
|
<a-select placeholder="请选择问卷状态" ref="select" v-model:value="queryParam.flag">
|
|
<a-select-option value="">全部</a-select-option>
|
|
<a-select-option value="-1">待提交</a-select-option>
|
|
<!-- <a-select-option value="0">待评分</a-select-option> -->
|
|
<a-select-option value="1">已完成</a-select-option>
|
|
</a-select>
|
|
</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>
|
|
<!--引用表格-->
|
|
<BasicTable @register="registerTable" style="margin-top:-20px;">
|
|
<!--操作栏-->
|
|
<template #action="{ record }">
|
|
<TableAction :actions="getTableAction(record)" />
|
|
</template>
|
|
<!--字段回显插槽-->
|
|
<template #htmlSlot="{ text }">
|
|
<div v-html="text"></div>
|
|
</template>
|
|
<!--省市区字段回显插槽-->
|
|
|
|
</BasicTable>
|
|
<!-- 表单区域 -->
|
|
<WjxWjxxTmlbDjModal ref="WjxWjxxTmlbDjModalPage" @success="handleSuccess"></WjxWjxxTmlbDjModal>
|
|
<WjxWjxxTmlbDjjgModal ref="WjxWjxxTmlbDjjgModalPage" @success="handleSuccess"></WjxWjxxTmlbDjjgModal>
|
|
</div>
|
|
</template>
|
|
|
|
<script lang="ts" name="zyInfoStudent-zyInfoStudent" setup>
|
|
import { ref, reactive, defineExpose, unref } from 'vue';
|
|
import { useListPage } from '/@/hooks/system/useListPage';
|
|
import { columnsKccyStu } from '/@/views/zy/zyInfoStudent/ZyInfoStudent.data';
|
|
import { stuKccyList } from '/@/views/zy/zyInfoStudent/ZyInfoStudent.api';
|
|
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
|
|
|
import WjxWjxxTmlbDjModal from '/@/views/kc/wjxWjxx/components/WjxWjxxTmlbDjModal.vue'
|
|
import WjxWjxxTmlbDjjgModal from '/@/views/kc/wjxWjxx/components/WjxWjxxTmlbDjjgModal.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 queryParam = ref<any>({ rwbh, xqxn, teano, atype: '6' });
|
|
|
|
const WjxWjxxTmlbDjModalPage = ref();
|
|
const WjxWjxxTmlbDjjgModalPage = ref();
|
|
|
|
//注册table数据
|
|
const { prefixCls, tableContext } = useListPage({
|
|
tableProps: {
|
|
api: stuKccyList,
|
|
columns: columnsKccyStu,
|
|
canResize: false,
|
|
useSearchForm: false,
|
|
actionColumn: {
|
|
width: '150px',
|
|
fixed: 'right',
|
|
},
|
|
showTableSetting: true,
|
|
defSort: {
|
|
field: 'name',
|
|
order: 'ascend',
|
|
},
|
|
beforeFetch: (params) => {
|
|
params.column = 'createTime', params.order = 'desc';//新生成的默认不带排序
|
|
return Object.assign(params, queryParam.value);
|
|
},
|
|
},
|
|
});
|
|
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 handleDj(record: Recordable) {
|
|
let timestamp = new Date().getTime();
|
|
let startTimestamp = Date.parse(record.startTime);
|
|
if (timestamp < startTimestamp) {
|
|
createMessage.error('还未到答卷时间!');
|
|
return;
|
|
}
|
|
let endTimestamp = Date.parse(record.endTime + " 23:59:59");
|
|
if (timestamp > endTimestamp) {
|
|
createMessage.error('答卷时间已过!');
|
|
return;
|
|
}
|
|
// WjxWjxxTmlbDjModalPage.value.disableSubmit = false;
|
|
// WjxWjxxTmlbDjModalPage.value.edit(record, false, "6", 'xs');
|
|
|
|
var url = "/site/studentDjcy?cytitle=" + record.title + "&cyid=" + record.id + "&cyatype=6&sfzd=0&sfbs=xs";
|
|
window.open(url, '_blank')
|
|
}
|
|
|
|
/**
|
|
* 答卷详情
|
|
*/
|
|
function handleDjjg(record: Recordable) {
|
|
WjxWjxxTmlbDjjgModalPage.value.disableSubmit = true;
|
|
WjxWjxxTmlbDjjgModalPage.value.edit(record.djId, false);
|
|
}
|
|
|
|
|
|
/**
|
|
* 成功回调
|
|
*/
|
|
function handleSuccess() {
|
|
selectedRowKeys.value = [];
|
|
reload();
|
|
}
|
|
|
|
/**
|
|
* 操作栏
|
|
*/
|
|
function getTableAction(record) {
|
|
|
|
|
|
// <a-button type="primary" @click="handleDj(item)" style="margin-left:5px;padding: 0px 8px;background:rgb(28, 132, 198);" v-if="item.flag=='-1'">开始测验</a-button>
|
|
// <a-button type="primary" style="margin-left:5px;padding: 0px 8px;background:rgb(28, 132, 198);color:#ffffff" v-if="item.flag=='0'" disabled>正在批卷</a-button>
|
|
// <a-button type="primary" @click="handleDjjg(item)" style="margin-left:5px;padding: 0px 8px;background:rgb(28, 132, 198);" v-if="item.flag=='1'">查看结果</a-button>
|
|
if (record.flag == '-1') {
|
|
var list = [
|
|
{
|
|
label: '开始测验',
|
|
onClick: handleDj.bind(null, record),
|
|
},
|
|
];
|
|
return list;
|
|
} else if (record.flag == '0') {
|
|
return null;
|
|
} else {
|
|
var list = [
|
|
{
|
|
label: '查看结果',
|
|
onClick: handleDjjg.bind(null, record),
|
|
},
|
|
];
|
|
return list;
|
|
}
|
|
|
|
}
|
|
|
|
/**
|
|
* 查询
|
|
*/
|
|
function searchQuery() {
|
|
selectedRowKeys.value = [];
|
|
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>
|