dbsd_kczx/src/views/kc/wjxWjxx/components/WjxWjxxTmlbAllDjjgsList.vue

179 lines
5.5 KiB
Vue
Raw Normal View History

2024-05-15 21:12:55 +08:00
<template>
<div>
2024-05-28 15:06:07 +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">
2024-10-15 18:21:39 +08:00
<a-col :span="24">
<a-button type="primary" @click="handleZgtpf">主观题评分</a-button>
</a-col>
2024-08-12 20:32:20 +08:00
<a-col :lg="6">
2024-05-28 15:06:07 +08:00
<a-form-item label="学生姓名">
<a-input placeholder="请输入学生姓名" v-model:value="queryParam.userName"></a-input>
</a-form-item>
</a-col>
2024-08-12 20:32:20 +08:00
<a-col :lg="6">
2024-05-28 15:06:07 +08:00
<a-form-item label="学生学号">
<a-input placeholder="请输入学生学号" v-model:value="queryParam.userId"></a-input>
</a-form-item>
</a-col>
2024-08-12 20:32:20 +08:00
<a-col :lg="6">
<a-form-item label="状态">
<a-select placeholder="请选择" v-model:value="queryParam.isFinished">
2024-08-13 15:03:20 +08:00
<a-select-option value="">全部</a-select-option>
2024-08-12 20:32:20 +08:00
<a-select-option value="0">未完成</a-select-option>
<a-select-option value="1">已完成</a-select-option>
</a-select>
</a-form-item>
</a-col>
2024-05-28 15:06:07 +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="reload">查询</a-button>
2024-10-15 18:21:39 +08:00
<a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls" style="margin-left: 8px"> 导出</a-button>
2024-05-28 15:06:07 +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>
</div>
2024-05-15 21:12:55 +08:00
<!--引用表格-->
2024-10-15 18:21:39 +08:00
<BasicTable @register="registerTable">
2024-05-15 21:12:55 +08:00
<!--操作栏-->
2024-10-15 18:21:39 +08:00
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" />
2024-05-15 21:12:55 +08:00
</template>
</BasicTable>
<!-- 表单区域 -->
2024-10-15 18:21:39 +08:00
<WjxWjxxTmlbDjjgModal ref="WjxWjxxTmlbDjjgModalPage" @success="reload"></WjxWjxxTmlbDjjgModal>
<ZgtpfModal ref="ZgtpfModalPage" @success="reload"></ZgtpfModal>
2024-05-15 21:12:55 +08:00
</div>
</template>
<script lang="ts" name="wjxWjxx-wjxWjxx" setup>
2024-10-15 18:21:39 +08:00
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, getExportUrl } from './WjxWjxxTmlbDjjgs.api';
import WjxWjxxTmlbDjjgModal from '/@/views/kc/wjxWjxx/components/WjxWjxxTmlbDjjgModal.vue';
import ZgtpfModal from '/@/views/kc/wjxWjxx/components/ZgtpfModal.vue';
2024-05-15 21:12:55 +08:00
2024-10-15 18:21:39 +08:00
const queryParam = ref<any>({});
const isFinished = ref<string>('');
const toggleSearchStatus = ref<boolean>(false);
const WjxWjxxTmlbDjjgModalPage = ref();
const ZgtpfModalPage = ref();
const sjxxInfo = ref<any>({});
//注册table数据
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: '',
api: list,
columns,
canResize: false,
useSearchForm: false,
actionColumn: {
width: 220,
fixed: 'right',
2024-05-28 15:06:07 +08:00
},
2024-10-15 18:21:39 +08:00
beforeFetch: (params) => {
(params.column = ''), (params.order = ''); //新生成的默认不带排序
return Object.assign(params, queryParam.value);
2024-05-28 15:52:43 +08:00
},
2024-10-15 18:21:39 +08:00
},
exportConfig: {
name: '学生测验信息',
url: getExportUrl,
params: () => {
return Object.assign({}, 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 },
});
2024-05-15 21:12:55 +08:00
2024-10-15 18:21:39 +08:00
/**
* 答卷详情
*/
function handlePeizhiDjjg(record: Recordable) {
WjxWjxxTmlbDjjgModalPage.value.disableSubmit = true;
WjxWjxxTmlbDjjgModalPage.value.edit(record.id, false);
}
2024-05-15 21:12:55 +08:00
2024-10-15 18:21:39 +08:00
function handleZgypf(record: Recordable) {
ZgtpfModalPage.value.disableSubmit = true;
ZgtpfModalPage.value.edit(record, false);
}
2024-10-15 18:21:39 +08:00
function handleZgtpf() {
console.log('👩‍🦰', sjxxInfo);
console.log('👩‍🦰', sjxxInfo.value.vid);
ZgtpfModalPage.value.disableSubmit = true;
ZgtpfModalPage.value.edit({vid:sjxxInfo.value.vid}, false);
}
2024-05-15 21:12:55 +08:00
2024-10-15 18:21:39 +08:00
/**
* 操作栏
*/
function getTableAction(record) {
if (record.commitTime != null && record.commitTime != '') {
return [
{
label: '答卷结果',
onClick: handlePeizhiDjjg.bind(null, record),
},
{
label: '主观题评分',
onClick: handleZgypf.bind(null, record),
ifShow: record.sfxysdpy == 1,
},
];
} else {
return [];
2024-05-15 21:12:55 +08:00
}
2024-10-15 18:21:39 +08:00
}
2024-05-15 21:12:55 +08:00
2024-10-15 18:21:39 +08:00
function init(record, flag) {
console.log('👨‍🦲', record);
sjxxInfo.value = record;
queryParam.value.id = record.id;
queryParam.value.rwbh = record.rwbh;
queryParam.value.isFinished = flag;
isFinished.value = flag;
reload();
}
2024-05-15 21:12:55 +08:00
2024-10-15 18:21:39 +08:00
defineExpose({
init,
});
2024-05-15 21:12:55 +08:00
</script>
<style lang="less" scoped>
2024-10-15 18:21:39 +08:00
.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;
2024-05-15 21:12:55 +08:00
}
2024-10-15 18:21:39 +08:00
}
2024-05-15 21:12:55 +08:00
</style>