问卷星:试卷页面调整、学生答卷结果查询

This commit is contained in:
曹磊 2024-05-10 21:15:47 +08:00
parent e07069e6bb
commit f42ec6eeca
11 changed files with 503 additions and 175 deletions

View File

@ -4,18 +4,28 @@ import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
// {
// title: '创建人',
// align: "center",
// dataIndex: 'createBy'
// },
// {
// title: '创建时间',
// align: "center",
// dataIndex: 'createTime',
// customRender:({text}) =>{
// return !text?"":(text.length>10?text.substr(0,10):text);
// },
// },
{
title: '创建人',
title: '学年学期',
align: "center",
dataIndex: 'createBy'
dataIndex: 'xnxq'
},
{
title: '创建时间',
title: '课程名称',
align: "center",
dataIndex: 'createTime',
customRender:({text}) =>{
return !text?"":(text.length>10?text.substr(0,10):text);
},
dataIndex: 'kcmc'
},
{
title: '问卷名称',
@ -29,11 +39,21 @@ export const columns: BasicColumn[] = [
customRender: ({ text }) => {
let dictMap = {
'1': '调查',
'6': '考试',
'6': '随堂练',
}
return dictMap[text??''];
}
},
{
title: '开始时间',
align: "center",
dataIndex: 'startTime'
},
{
title: '结束时间',
align: "center",
dataIndex: 'endTime'
},
{
title: '问卷描述',
align: "center",

View File

@ -1,14 +1,22 @@
<template>
<div>
<div style="background: #fff;height: 97%;margin: 10px 0;">
<!--查询区域-->
<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-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.qpublish">
<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">
@ -21,80 +29,96 @@
</a-row>
</a-form>
</div>
<!--引用表格-->
<BasicTable @register="registerTable" >
<!--插槽:table标题-->
<template #tableTitle>
<!-- <a-button type="primary" @click="init" preIcon="ant-design:plus-outlined"> 登录</a-button> -->
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)"/>
</template>
<!--字段回显插槽-->
<template #htmlSlot="{text}">
<div v-html="text"></div>
</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>
<a-row>
<a-col :span="8" v-for="(item, index) in tableData" :key="index" style="padding: 0px 0px 10px 5px;overflow:hidden;">
<div style="width: 100%; height: 20px; background-color: rgb(28, 132, 198);"></div>
<a-card style="height: 280px;">
<div class="rotate" >{{item.qpublish =='0'? '待发布':'已发布'}}</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>
<a-col :span="6" class="zyCon">时间
</a-col>
<a-col :span="16" class="zyCon">
<a-col :span="24" class="zyCon">{{item.startTime}}</a-col>
<a-col :span="24" class="zyCon">{{item.endTime}}</a-col>
</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">{{item.xkrs}}人选课</a-col>
</a-row>
</a-col>
<a-col :span="24" style="text-align:center;margin-top:20px;">
<a-button type="primary" @click="handleEdit(item)" style="margin-left:5px;padding: 0px 8px;background:rgb(28, 132, 198);" v-if="item.qpublish==0">编辑</a-button>
<a-button type="primary" @click="handlePeizhi(item)" style="margin-left:5px;padding: 0px 8px;background:rgb(28, 132, 198);" v-if="item.qpublish==0">配置</a-button>
<a-button type="primary" @click="handleFabu(item)" style="margin-left:5px;padding: 0px 8px;background:rgb(28, 132, 198);" v-if="item.qpublish==0">发布</a-button>
<a-button type="primary" @click="handleDelete(item)" style="margin-left:5px;padding: 0px 8px;background:rgb(28, 132, 198);" v-if="item.qpublish==0">删除</a-button>
<a-button type="primary" @click="handleDetail(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="handlePeizhiXq(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="handleDjjgs(item)" style="margin-left:5px;padding: 0px 8px;background:rgb(28, 132, 198);" v-if="item.qpublish==1">结果</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>
<!-- 表单区域 -->
<WjxWjxxModal ref="registerModal" @success="handleSuccess"></WjxWjxxModal>
<WjxWjxxTmlbModal ref="WjxWjxxTmlbModalPage" @success="handleSuccess"></WjxWjxxTmlbModal>
<WjxWjxxTmlbDjModal ref="WjxWjxxTmlbDjModalPage" @success="handleSuccess"></WjxWjxxTmlbDjModal>
<WjxWjxxTmlbDjjgModal ref="WjxWjxxTmlbDjjgModalPage" @success="handleSuccess"></WjxWjxxTmlbDjjgModal>
<WjxWjxxTmlbDjjgsModal ref="WjxWjxxTmlbDjjgsModalPage" @success="handleSuccess"></WjxWjxxTmlbDjjgsModal>
</div>
</template>
<script lang="ts" name="wjxWjxx-wjxWjxx" setup>
import { ref, reactive,defineExpose } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import {ref, reactive, defineExpose, unref, onMounted} from 'vue';
import { defHttp } from '/@/utils/http/axios';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns } from './WjxWjxx.data';
import { Input, Popover, Pagination, Empty } from 'ant-design-vue';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './WjxWjxx.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import WjxWjxxModal from './components/WjxWjxxModal.vue'
import WjxWjxxTmlbModal from '/@/views/kc/wjxWjxx/components/WjxWjxxTmlbModal.vue'
import WjxWjxxTmlbDjModal from '/@/views/kc/wjxWjxx/components/WjxWjxxTmlbDjModal.vue'
import WjxWjxxTmlbDjjgModal from '/@/views/kc/wjxWjxx/components/WjxWjxxTmlbDjjgModal.vue'
import WjxWjxxTmlbDjjgsModal from '/@/views/kc/wjxWjxx/components/WjxWjxxTmlbDjjgsModal.vue'
import {useRouter} from "vue-router";
//
const { currentRoute } = useRouter();
const { query } = unref(currentRoute);
const { rwbh,xqxn } = query;//
const APagination = Pagination;
const queryParam = ref<any>({});
const toggleSearchStatus = ref<boolean>(false);
const current = ref<number>(0);
const total = ref<number>(0);
const pageNo = ref<number>(0);
const pageSize = ref<number>(6);
const tableData = ref<any>([]);
const registerModal = ref();
const WjxWjxxTmlbModalPage = ref();
const WjxWjxxTmlbDjModalPage = ref();
const WjxWjxxTmlbDjjgModalPage = ref();
//table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: '问卷信息',
api: list,
columns,
canResize:false,
useSearchForm: false,
actionColumn: {
width: 280,
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 WjxWjxxTmlbDjjgsModalPage = ref();
const labelCol = reactive({
xs: { span: 24 },
sm: { span: 7 },
@ -109,7 +133,7 @@
*/
function handleAdd() {
registerModal.value.disableSubmit = false;
registerModal.value.add();
registerModal.value.add("6");
}
/**
@ -139,7 +163,7 @@
/**
* 答卷详情
*/
function handlePeizhiDj(record: Recordable) {
function handleDj(record: Recordable) {
WjxWjxxTmlbDjModalPage.value.disableSubmit = false;
WjxWjxxTmlbDjModalPage.value.edit(record,false);
}
@ -147,11 +171,19 @@
/**
* 答卷详情
*/
function handlePeizhiDjjg(record: Recordable) {
function handleDjjg(record: Recordable) {
WjxWjxxTmlbDjjgModalPage.value.disableSubmit = true;
WjxWjxxTmlbDjjgModalPage.value.edit(record,false);
}
/**
* 学生答卷列表
*/
function handleDjjgs(record: Recordable) {
WjxWjxxTmlbDjjgsModalPage.value.disableSubmit = true;
WjxWjxxTmlbDjjgsModalPage.value.edit(record,false);
}
/**
* 详情
*/
@ -160,8 +192,13 @@
registerModal.value.edit(record);
}
/**
* 发布
*/
function handleFabu(record: Recordable) {
defHttp.get({ url: '/wjxWjxx/wjxWjxx/fbwj', params: { id: record.id } }).then(res => {
total.value = 1;
pageNo.value = 0;
reload();
});
}
@ -172,83 +209,35 @@
await deleteOne({ id: record.id }, handleSuccess);
}
/**
* 批量删除事件
*/
async function batchHandleDelete() {
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
function reload(){
queryParam.value.pageNo = pageNo;
queryParam.value.pageSize = pageSize;
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;
});
}
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
/**
* 操作栏
*/
function getTableAction(record) {
if(record.qpublish == '1'){
return [
{
label: '配置详情',
onClick: handlePeizhiXq.bind(null, record),
},
{
label: '详情',
onClick: handleDetail.bind(null, record),
},
{
label: '答卷',
onClick: handlePeizhiDj.bind(null, record),
},
{
label: '答卷结果',
onClick: handlePeizhiDjjg.bind(null, record),
},
]
}else{
return [
{
label: '编辑',
onClick: handleEdit.bind(null, record),
},
{
label: '配置',
onClick: handlePeizhi.bind(null, record),
},
{
label: '发布',
onClick: handleFabu.bind(null, record),
},
{
label: '详情',
onClick: handleDetail.bind(null, record),
}, {
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
}
}
]
};
}
/**
* 下拉操作栏
*/
function getDropDownAction(record) {
return [
]
total.value = 1;
pageNo.value = 0;
reload();
}
/**
* 查询
*/
function searchQuery() {
pageNo.value = 0;
reload();
}
@ -257,27 +246,24 @@
*/
function searchReset() {
queryParam.value = {};
selectedRowKeys.value = [];
//
total.value = 1;
handlePageChange(1);
}
function handlePageChange(record){
pageNo.value = record;
reload();
}
function init(){
defHttp.get({url:'/wjxWjxx/wjxWjxx/getWjxLogin',params:{}}).then(res =>{
})
}
defineExpose({
init
onMounted(() => {
searchQuery();
});
</script>
<style lang="less" scoped>
.jeecg-basic-table-form-container {
padding: 0;
.table-page-search-submitButtons {
display: block;
margin-bottom: 24px;
@ -293,4 +279,31 @@
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;
}
</style>

View File

@ -8,15 +8,13 @@
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="问卷类型" v-bind="validateInfos.atype">
<a-select
ref="select"
v-model:value="formData.atype"
style="width: 120px"
>
<a-select-option value="1">调查</a-select-option>
<a-select-option value="6">考试</a-select-option>
</a-select>
<a-form-item label="开始时间" v-bind="validateInfos.startTime">
<a-date-picker placeholder="请选择开始时间" v-model:value="formData.startTime" value-format="YYYY-MM-DD HH:mm:ss" :show-time="true" style="width: 100%" :disabled="disabled"/>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="结束时间" v-bind="validateInfos.endTime">
<a-date-picker placeholder="请选择结束时间" v-model:value="formData.endTime" value-format="YYYY-MM-DD HH:mm:ss" :show-time="true" style="width: 100%" :disabled="disabled"/>
</a-form-item>
</a-col>
<a-col :span="24">
@ -24,37 +22,55 @@
<a-textarea v-model:value="formData.content" rows="4" placeholder="请输入问卷描述" :disabled="disabled"/>
</a-form-item>
</a-col>
<!-- <a-col :span="24">
<a-form-item label="是否发布问卷" v-bind="validateInfos.qpublish">
<j-dict-select-tag type='radio' v-model:value="formData.qpublish" dictCode="yn" placeholder="请选择是否发布问卷" :disabled="disabled"/>
<a-col :span="24">
<a-form-item label="学年学期">
<a-input v-model:value="formData.xqxn" disabled></a-input>
</a-form-item>
</a-col> -->
</a-col>
<a-col :span="24">
<a-form-item label="课程名称">
<a-input v-model:value="formData.kcmc" disabled></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="选课人数">
<a-input v-model:value="formData.xkrs" disabled></a-input>
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-spin>
</template>
<script lang="ts" setup>
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted } from 'vue';
import {ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted, unref} from 'vue';
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from '/@/hooks/web/useMessage';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import { getValueType } from '/@/utils';
import { saveOrUpdate } from '../WjxWjxx.api';
import { Form } from 'ant-design-vue';
import {useRouter} from "vue-router";
//
const { currentRoute } = useRouter();
const { query } = unref(currentRoute);
const { rwbh,xqxn } = query;//
const props = defineProps({
formDisabled: { type: Boolean, default: false },
formData: { type: Object, default: ()=>{} },
formBpm: { type: Boolean, default: true }
});
const atype = ref(<string>(''));
const formRef = ref();
const useForm = Form.useForm;
const emit = defineEmits(['register', 'ok']);
const formData = reactive<Record<string, any>>({
id: '',
title: '',
atype: '1',
atype: '',
content: '',
// qpublish: '',
});
@ -64,8 +80,7 @@
const confirmLoading = ref<boolean>(false);
//
const validatorRules = {
title: [{ required: true, message: '请输入问卷名称!'},],
atype: [{ required: true, message: '请选择问卷类型!'},],
title: [{ required: true, message: '请输入问卷名称!'},]
};
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: true });
@ -81,12 +96,25 @@
return props.formDisabled;
});
function init(){
defHttp.get({ url: '/wjxWjxx/wjxWjxx/kcxx', params: { rwbh: rwbh,xqxn: xqxn } }).then(res => {
formData.xqxn = xqxn;
formData.rwbh = rwbh;
formData.atype = atype.value;
formData.kcmc = res.kcmc;
formData.xkrs = res.xkrs;
formData.startTime = '';
formData.endTime = '';
});
}
/**
* 新增
*/
function add() {
function add(value) {
atype.value = value;
edit({});
init();
}
/**

View File

@ -7,7 +7,7 @@
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import WjxWjxxForm from './WjxWjxxForm.vue'
const title = ref<string>('');
const width = ref<number>(800);
const visible = ref<boolean>(false);
@ -18,14 +18,14 @@
/**
* 新增
*/
function add() {
function add(value) {
title.value = '新增';
visible.value = true;
nextTick(() => {
registerForm.value.add();
registerForm.value.add(value);
});
}
/**
* 编辑
* @param record
@ -37,7 +37,7 @@
registerForm.value.edit(record);
});
}
/**
* 确定按钮点击事件
*/

View File

@ -86,7 +86,7 @@ function edit(record,isDisabled){
title.value = record.title;
mainId.value = record.id;
defHttp.get({url:'/wjxWjxxTmlb/wjxWjxxTmlb/queryByMainId',params:{id:record.id}}).then(res =>{
console.log(`🚀 ~ defHttp.get ~ res:`, res)
// console.log(`🚀 ~ defHttp.get ~ res:`, res)
var list = res;
for(var i=0;i<list.length;i++){
var par = list[i];
@ -107,7 +107,7 @@ function edit(record,isDisabled){
//
async function submitForm(){
const data = tiganData.value;
console.log(`🚀 ~ submitForm ~ data:`, data)
// console.log(`🚀 ~ submitForm ~ data:`, data)
const values = Object.assign([], data);
for(var i=0;i<values.length;i++){
var param = values[i];

View File

@ -5,8 +5,9 @@
<a-col :span="24" style="overflow-y: scroll;height: calc(80vh);">
<div style="text-align: center;width: 100%;font-weight: bold;font-size: 20px;padding: 20px;">{{ djxxData.title }}</div>
<div style="text-align: right;font-size: 16px;padding-right: 20px;">
<span v-if="djxxData.atype == 6" style="text-decoration: underline;margin-right: 15px;">总分{{ djxxData.totalScore }} </span>
<span v-if="djxxData.atype == 6" style="text-decoration: underline;margin-right: 15px;">得分{{ djxxData.score }} </span>
<span style="text-decoration: underline;margin-right: 15px;">答卷人{{ djxxData.userName }} </span>
<span v-if="djxxData.atype == 6" style="text-decoration: underline;margin-right: 15px;">总分{{ djxxData.totalScore }} </span>
<span v-if="djxxData.atype == 6" style="text-decoration: underline;margin-right: 15px;">得分{{ djxxData.score }} </span>
<span style="text-decoration: underline;margin-right: 15px;">用时{{djxxData.answerSfm}} </span>
</div>
<!-- 题干信息 -->
@ -87,12 +88,11 @@ function edit(record){
tiganData.value = [];
mainId.value = record.id;
defHttp.get({url:'/wjxDjxx/queryByMainId',params:{id:record.id}}).then(res =>{
console.log(`🚀 ~ defHttp.get ~ res:`, res)
// console.log(`🚀 ~ defHttp.get ~ res:`, res)
let djxx = res;
let list = djxx.wjxDjxxTmxxList;
for(let i=0;i<list.length;i++){
let par = list[i];
console.log(par);
if(par.wjType==4){
let lssj = par.itemSelected.split(",");
const numArray = lssj.map(str => parseInt(str));

View File

@ -0,0 +1,15 @@
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";
const { createConfirm } = useMessage();
enum Api {
list = '/wjxDjxx/djjglist',
}
/**
*
* @param params
*/
export const list = (params) => defHttp.get({ url: Api.list, params });

View File

@ -0,0 +1,82 @@
import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
{
title: '问卷名称',
align: "center",
dataIndex: 'title'
},
{
title: '学生',
align: "center",
dataIndex: 'userName'
},
{
title: '得分',
align: "center",
dataIndex: 'score'
},
{
title: '总分数',
align: "center",
dataIndex: 'totalScore'
},
{
title: '答卷时间',
align: "center",
dataIndex: 'openTime'
},
{
title: '交卷时间',
align: "center",
dataIndex: 'commitTime'
},
{
title: '答卷用时',
align: "center",
dataIndex: 'answerSfm'
},
{
title: '学期学年',
align: "center",
dataIndex: 'xqxn'
},
{
title: '课程名称',
align: "center",
dataIndex: 'kcmc'
},
{
title: '开始时间',
align: "center",
dataIndex: 'startTime'
},
{
title: '结束时间',
align: "center",
dataIndex: 'endTime'
},
{
title: '问卷描述',
align: "center",
dataIndex: 'content'
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
// TODO 主键隐藏字段目前写死为ID
{
label: '',
field: 'id',
component: 'Input',
show: false,
},
];

View File

@ -0,0 +1,107 @@
<template>
<div>
<!--引用表格-->
<BasicTable @register="registerTable" >
<!--插槽:table标题-->
<template #tableTitle>
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)"/>
</template>
</BasicTable>
<!-- 表单区域 -->
<WjxWjxxTmlbDjjgModal ref="WjxWjxxTmlbDjjgModalPage" @success="handleSuccess"></WjxWjxxTmlbDjjgModal>
</div>
</template>
<script lang="ts" name="wjxWjxx-wjxWjxx" setup>
import {ref, reactive, defineExpose, unref} from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { defHttp } from '/@/utils/http/axios';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns } from './WjxWjxxTmlbDjjgs.data';
import { list } from './WjxWjxxTmlbDjjgs.api';
import WjxWjxxTmlbDjjgModal from '/@/views/kc/wjxWjxx/components/WjxWjxxTmlbDjjgModal.vue'
const queryParam = ref<any>({});
const toggleSearchStatus = ref<boolean>(false);
const WjxWjxxTmlbDjjgModalPage = ref();
//table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: '学生问卷信息',
api: list,
columns,
canResize:false,
useSearchForm: false,
actionColumn: {
width: 120,
fixed: 'right',
},
beforeFetch: (params) => {
params.column = '',params.order = '';//
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 handlePeizhiDjjg(record: Recordable) {
WjxWjxxTmlbDjjgModalPage.value.disableSubmit = true;
WjxWjxxTmlbDjjgModalPage.value.edit(record,false);
}
/**
* 操作栏
*/
function getTableAction(record) {
return [
{
label: '答卷结果',
onClick: handlePeizhiDjjg.bind(null, record),
}
]
}
function init(record){
queryParam.value.id = record.id;
reload();
}
defineExpose({
init
});
</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

@ -0,0 +1,63 @@
<template>
<a-modal :title="title" :width="width" centered :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
<WjxWjxxTmlbDjjgsList ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></WjxWjxxTmlbDjjgsList>
</a-modal>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import WjxWjxxTmlbDjjgsList from './WjxWjxxTmlbDjjgsList.vue'
const title = ref<string>('');
const width = ref<string>('80%');
const visible = ref<boolean>(false);
const disableSubmit = ref<boolean>(false);
const registerForm = ref();
const emit = defineEmits(['register', 'success']);
/**
* 编辑
* @param record
*/
function edit(record) {
title.value = disableSubmit.value ? '答卷结果' : '编辑';
visible.value = true;
nextTick(() => {
registerForm.value.init(record);
});
}
/**
* 确定按钮点击事件
*/
function handleOk() {
registerForm.value.submitForm();
}
/**
* form保存回调事件
*/
function submitCallback() {
handleCancel();
emit('success');
}
/**
* 取消按钮回调事件
*/
function handleCancel() {
visible.value = false;
}
defineExpose({
edit,
disableSubmit,
});
</script>
<style>
/**隐藏样式-modal确定按钮 */
.jee-hidden {
display: none !important;
}
</style>

View File

@ -140,7 +140,7 @@ function handleRemTmxx(record,index,list){
}
}
function getType(value,type){
console.log(`🚀 ~ getType ~ value,type:`, value,type)
// console.log(`🚀 ~ getType ~ value,type:`, value,type)
if(type=='3'){
return parseInt(value);
}else if(type=='4'){
@ -153,7 +153,7 @@ function edit(record){
title.value = record.title;
mainId.value = record.id;
defHttp.get({url:'/wjxWjxxTmlb/wjxWjxxTmlb/queryByMainId',params:{id:record.id}}).then(res =>{
console.log(`🚀 ~ defHttp.get ~ res:`, res)
// console.log(`🚀 ~ defHttp.get ~ res:`, res)
var list = res;
for(var i=0;i<list.length;i++){
var par = list[i];
@ -170,7 +170,7 @@ function edit(record){
//
async function submitForm(){
const data = tiganData.value;
console.log(`🚀 ~ submitForm ~ data:`, data)
// console.log(`🚀 ~ submitForm ~ data:`, data)
const values = Object.assign([], data);
for(var i=0;i<values.length;i++){
var param = values[i];