【修改】 wps出题页面
This commit is contained in:
@@ -277,7 +277,8 @@
|
||||
</div>
|
||||
<!-- 表单弹窗:添加/修改 -->
|
||||
<FileForm ref="FileRef" @success="handleUploadSuccess" />
|
||||
<el-dialog v-model="dialogFormVisiblePptxInfo" title="考点设置" width="400px">
|
||||
|
||||
<!-- <el-dialog v-model="dialogFormVisiblePptxInfo" title="考点设置" width="400px">
|
||||
<el-tree
|
||||
style="max-width: 600px"
|
||||
:data="pptxPointsList"
|
||||
@@ -285,6 +286,47 @@
|
||||
:expand-on-click-node="false"
|
||||
@node-click="handleNodelClick"
|
||||
/>
|
||||
</el-dialog> -->
|
||||
<el-dialog v-model="dialogFormVisiblePptxInfo" title="考点设置" width="70%">
|
||||
<div style="height: 400px; overflow: hidden; display: flex; gap: 16px">
|
||||
<div style="flex: 0.5; overflow: auto; border: 1px solid #eee; padding: 8px">
|
||||
<h3>考点</h3>
|
||||
<el-tree
|
||||
style="max-width: 600px"
|
||||
:data="pptxPointsList"
|
||||
:props="defaultProps"
|
||||
:expand-on-click-node="false"
|
||||
@node-click="handleNodelClick"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div style="flex: 1.5; overflow: auto; border: 1px solid #eee; padding: 8px">
|
||||
<h3>设置考点</h3>
|
||||
<el-table :data="list" style="width: 100%">
|
||||
<el-table-column prop="contentIn" label="值" width="500px" />
|
||||
|
||||
<el-table-column prop="scoreRate" label="权值" width="100">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.scoreRate" size="small" style="width: 40px" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作" width="100">
|
||||
<template #default="{ row }">
|
||||
<span
|
||||
@click="removePoint(row)"
|
||||
style="cursor: pointer; font-weight: bold; font-size: 18px"
|
||||
title="点击删除"
|
||||
>—</span
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <el-skeleton :rows="5" animated v-if="wordPointsList.length < 0 && isLoading" />
|
||||
-->
|
||||
</el-dialog>
|
||||
<el-dialog v-model="dialogFormVisiblePptxInfos" :title="titles" width="300px">
|
||||
<el-tree
|
||||
@@ -302,6 +344,7 @@
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import draggable from 'vuedraggable'
|
||||
import { DICT_TYPE, getIntDictOptions, getStrDictOptions } from '@/utils/dict'
|
||||
import { FormRules } from 'element-plus'
|
||||
import * as QuestionApi from '@/api/paper/question'
|
||||
@@ -393,7 +436,9 @@ const handleDelete = (row) => {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const removePoint = (index: number) => {
|
||||
list.value.splice(index, 1)
|
||||
}
|
||||
function fileTypeFormatter(row, column, cellValue) {
|
||||
if (cellValue === '0') return '素材文件(上传ZIP)'
|
||||
if (cellValue === '1') return '考试文件'
|
||||
@@ -487,6 +532,7 @@ const handleNodelClick = async (row: any) => {
|
||||
filePath.value = row.filePath
|
||||
paragraph.value = row.selectName
|
||||
englishNames.value = row.englishName
|
||||
console.log(row)
|
||||
const res = await PptxApi.getPptxInfos(row.title)
|
||||
pptxPointsInfoList.value = []
|
||||
pptxPointsInfoList.value.push(...handleTree(res))
|
||||
@@ -497,23 +543,27 @@ const submitPptxPoints = async () => {
|
||||
pptxPointsInfosList = []
|
||||
console.log(list.value)
|
||||
var indexFlag = false
|
||||
let index = 0
|
||||
for (let i = 0; i < res.length; i++) {
|
||||
for (let x = 0; x < list.value.length; x++) {
|
||||
if (res[i].contentIn == list.value[x].contentIn) {
|
||||
// 如果存在相同的数据话 不进入
|
||||
indexFlag = true
|
||||
|
||||
console.log(res)
|
||||
if (res != null) {
|
||||
for (let i = 0; i < res.length; i++) {
|
||||
for (let x = 0; x < list.value.length; x++) {
|
||||
if (res[i].contentIn == list.value[x].contentIn) {
|
||||
// 如果存在相同的数据话 不进入
|
||||
indexFlag = true
|
||||
}
|
||||
}
|
||||
if (!indexFlag) {
|
||||
// 排序,使用已经存在考点的数组的长度+1
|
||||
res[i].sort = list.value.length + 1
|
||||
list.value.push(res[i])
|
||||
}
|
||||
}
|
||||
if (!indexFlag) {
|
||||
index += 1;
|
||||
res[i].sort = index;
|
||||
list.value.push(res[i])
|
||||
}
|
||||
}
|
||||
dialogFormVisiblePptxInfo.value = false
|
||||
|
||||
// dialogFormVisiblePptxInfo.value = false
|
||||
dialogFormVisiblePptxInfos.value = false
|
||||
pptxPointsList.value = []
|
||||
// pptxPointsList.value = []
|
||||
}
|
||||
const formRules = reactive<FormRules>({
|
||||
status: [{ required: true, message: '启用状态必填', trigger: 'blur' }]
|
||||
@@ -904,4 +954,4 @@ const openPoints = async () => {
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
Reference in New Issue
Block a user