|
@@ -1,77 +1,72 @@
|
|
<template>
|
|
<template>
|
|
<div class="plan-index-container layout-padding">
|
|
<div class="plan-index-container layout-padding">
|
|
<div class="layout-padding-auto layout-padding-view pd20">
|
|
<div class="layout-padding-auto layout-padding-view pd20">
|
|
- <vxe-toolbar
|
|
|
|
- ref="toolbarRef"
|
|
|
|
- :loading="state.tableLoading"
|
|
|
|
- custom
|
|
|
|
- :refresh="{
|
|
|
|
- queryMethod: handleQuery,
|
|
|
|
- }"
|
|
|
|
- >
|
|
|
|
- <template #buttons>
|
|
|
|
- <el-button type="primary" @click="onAdd" v-auth="'practice:index:add'" :loading="state.tableLoading">
|
|
|
|
- <SvgIcon name="ele-Plus" class="mr10" />新增练习
|
|
|
|
- </el-button>
|
|
|
|
- </template>
|
|
|
|
- </vxe-toolbar>
|
|
|
|
- <div style="overflow: hidden; width: 100%; height: 100%; flex: 1">
|
|
|
|
- <vxe-table
|
|
|
|
- border
|
|
|
|
- :loading="state.tableLoading"
|
|
|
|
- :data="state.tableData"
|
|
|
|
- :column-config="{ resizable: true }"
|
|
|
|
- :row-config="{ isCurrent: true, isHover: true, height: 30, useKey: true }"
|
|
|
|
- ref="tableRef"
|
|
|
|
- height="auto"
|
|
|
|
- auto-resize
|
|
|
|
- show-overflow
|
|
|
|
- :print-config="{}"
|
|
|
|
- :scrollY="{ enabled: true, gt: 100 }"
|
|
|
|
- id="examTrainExamPractice"
|
|
|
|
- :custom-config="{ storage: true }"
|
|
|
|
- showHeaderOverflow
|
|
|
|
- >
|
|
|
|
- <vxe-column field="code" title="练习流水号" width="200"></vxe-column>
|
|
|
|
- <vxe-column field="count" title="出题数量" width="150"></vxe-column>
|
|
|
|
- <vxe-column field="practiceTime" title="练习时间" min-width="160">
|
|
|
|
|
|
+ <vxe-toolbar
|
|
|
|
+ ref="toolbarRef"
|
|
|
|
+ :loading="state.tableLoading"
|
|
|
|
+ custom
|
|
|
|
+ :refresh="{
|
|
|
|
+ queryMethod: handleQuery,
|
|
|
|
+ }"
|
|
|
|
+ >
|
|
|
|
+ <template #buttons>
|
|
|
|
+ <el-button type="primary" @click="onAdd" v-auth="'practice:index:add'" :loading="state.tableLoading">
|
|
|
|
+ <SvgIcon name="ele-Plus" class="mr10" />新增练习
|
|
|
|
+ </el-button>
|
|
|
|
+ </template>
|
|
|
|
+ </vxe-toolbar>
|
|
|
|
+ <div style="overflow: hidden; width: 100%; height: 100%; flex: 1">
|
|
|
|
+ <vxe-table
|
|
|
|
+ border
|
|
|
|
+ :loading="state.tableLoading"
|
|
|
|
+ :data="state.tableData"
|
|
|
|
+ :column-config="{ resizable: true }"
|
|
|
|
+ :row-config="{ isCurrent: true, isHover: true, height: 30, useKey: true }"
|
|
|
|
+ ref="tableRef"
|
|
|
|
+ height="auto"
|
|
|
|
+ auto-resize
|
|
|
|
+ show-overflow
|
|
|
|
+ :print-config="{}"
|
|
|
|
+ :scrollY="{ enabled: true, gt: 100 }"
|
|
|
|
+ id="examTrainExamPractice"
|
|
|
|
+ :custom-config="{ storage: true }"
|
|
|
|
+ showHeaderOverflow
|
|
|
|
+ >
|
|
|
|
+ <vxe-column field="code" title="练习流水号" width="200"></vxe-column>
|
|
|
|
+ <vxe-column field="count" title="出题数量" width="150"></vxe-column>
|
|
|
|
+ <vxe-column field="practiceTime" title="练习时间" min-width="160">
|
|
<template #default="{ row }">
|
|
<template #default="{ row }">
|
|
{{ formatDate(row.practiceTime, 'YYYY-mm-dd HH:MM:SS') }}
|
|
{{ formatDate(row.practiceTime, 'YYYY-mm-dd HH:MM:SS') }}
|
|
</template>
|
|
</template>
|
|
</vxe-column>
|
|
</vxe-column>
|
|
- <vxe-column title="操作" fixed="right" width="120" align="center" :show-overflow="false">
|
|
|
|
- <template #default="{ row }">
|
|
|
|
- <el-button link type="primary" @click="onView(row)" title="查看" v-auth="'practice:index:view'">
|
|
|
|
- 查看
|
|
|
|
- </el-button>
|
|
|
|
- </template>
|
|
|
|
- </vxe-column>
|
|
|
|
- </vxe-table>
|
|
|
|
- </div>
|
|
|
|
- <pagination
|
|
|
|
- @pagination="queryList"
|
|
|
|
- :total="state.total"
|
|
|
|
- v-model:current-page="state.queryParams.PageIndex"
|
|
|
|
- v-model:page-size="state.queryParams.PageSize"
|
|
|
|
- :disabled="state.tableLoading"
|
|
|
|
- />
|
|
|
|
|
|
+ <vxe-column title="操作" fixed="right" width="120" align="center" :show-overflow="false">
|
|
|
|
+ <template #default="{ row }">
|
|
|
|
+ <el-button link type="primary" @click="onView(row)" title="查看" v-auth="'practice:index:view'"> 查看 </el-button>
|
|
|
|
+ </template>
|
|
|
|
+ </vxe-column>
|
|
|
|
+ </vxe-table>
|
|
|
|
+ </div>
|
|
|
|
+ <pagination
|
|
|
|
+ @pagination="queryList"
|
|
|
|
+ :total="state.total"
|
|
|
|
+ v-model:current-page="state.queryParams.PageIndex"
|
|
|
|
+ v-model:page-size="state.queryParams.PageSize"
|
|
|
|
+ :disabled="state.tableLoading"
|
|
|
|
+ />
|
|
</div>
|
|
</div>
|
|
- <practice-add ref="practiceAddRef" @choose="onOpenExam" />
|
|
|
|
|
|
+ <practice-add ref="practiceAddRef" @choose="onOpenExam" />
|
|
<practice-exam ref="practiceExamRef" @updateList="queryList" />
|
|
<practice-exam ref="practiceExamRef" @updateList="queryList" />
|
|
<practice-view ref="practiceViewRef" />
|
|
<practice-view ref="practiceViewRef" />
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script lang="tsx" setup name="examTrainExamPractice">
|
|
<script lang="tsx" setup name="examTrainExamPractice">
|
|
-import { ref, reactive, onMounted, defineAsyncComponent, computed } from 'vue';
|
|
|
|
-import { ElMessageBox, ElMessage } from 'element-plus';
|
|
|
|
|
|
+import { ref, reactive, onMounted, defineAsyncComponent } from 'vue';
|
|
import { useRouter } from 'vue-router';
|
|
import { useRouter } from 'vue-router';
|
|
-import type { FormInstance } from 'element-plus';
|
|
|
|
import { formatDate } from '@/utils/formatTime';
|
|
import { formatDate } from '@/utils/formatTime';
|
|
import 'splitpanes/dist/splitpanes.css';
|
|
import 'splitpanes/dist/splitpanes.css';
|
|
import Other from '@/utils/other';
|
|
import Other from '@/utils/other';
|
|
-import { downloadFileByStream } from '@/utils/tools';
|
|
|
|
-import {getPracticeData} from '@/api/examTrain/practice';
|
|
|
|
|
|
+import { getPracticeData } from '@/api/examTrain/practice';
|
|
|
|
|
|
// 引入组件
|
|
// 引入组件
|
|
const pagination = defineAsyncComponent(() => import('@/components/ProTable/components/Pagination.vue')); // 分页
|
|
const pagination = defineAsyncComponent(() => import('@/components/ProTable/components/Pagination.vue')); // 分页
|
|
@@ -117,10 +112,10 @@ const onAdd = () => {
|
|
practiceAddRef.value.openDialog(state.tableData.value);
|
|
practiceAddRef.value.openDialog(state.tableData.value);
|
|
};
|
|
};
|
|
const practiceExamRef = ref<RefType>(); // 练习ref
|
|
const practiceExamRef = ref<RefType>(); // 练习ref
|
|
-const onOpenExam = (practiceId) => {
|
|
|
|
- console.log(practiceId);
|
|
|
|
|
|
+const onOpenExam = (practiceId: string) => {
|
|
|
|
+ queryList();
|
|
practiceExamRef.value.openDialog(practiceId);
|
|
practiceExamRef.value.openDialog(practiceId);
|
|
-}
|
|
|
|
|
|
+};
|
|
// 打开查看弹窗
|
|
// 打开查看弹窗
|
|
const practiceViewRef = ref<RefType>(); // 修改ref
|
|
const practiceViewRef = ref<RefType>(); // 修改ref
|
|
const onView = (row: any) => {
|
|
const onView = (row: any) => {
|