This commit is contained in:
陆光LG
2025-08-17 20:03:32 +08:00
3 changed files with 43 additions and 24 deletions

View File

@@ -407,7 +407,7 @@ const formData = ref({
// 定义 pptxPoints 类型
interface PptxPoints {
firstName: string;
index: string;
slideIndex: string;
function: string;
examName: string;
examCode: string;
@@ -458,7 +458,7 @@ const handleCheckChange = (data: any, _checked: boolean, _indeterminate: boolean
console.log(data)
const pptxPoints: PptxPoints = {
firstName: '',
index: '',
slideIndex: '',
function: '',
examName: '',
examCode: '',
@@ -466,7 +466,7 @@ const handleCheckChange = (data: any, _checked: boolean, _indeterminate: boolean
}
if (data.functions != null && data.functions != '') {
pptxPoints.firstName = chineseName.value
pptxPoints.index = textIndex.value
pptxPoints.slideIndex = textIndex.value
pptxPoints.function = data.functions
pptxPoints.examName = data.chineseName
pptxPoints.examCode = '111'

View File

@@ -515,9 +515,9 @@ const submitWordPoints = async () => {
wordPointsInfosList = []
console.log(res)
for (let i = 0; i < res.data.length; i++) {
res.data[i].scoreRate='1'
var indexFlag = false
for (let x = 0; x < list.value.length; x++) {
list.value[x].scoreRate='1'
if (res.data[i].content == list.value[x].content) {
// 如果存在相同的数据话 不进入
indexFlag = true

View File

@@ -308,7 +308,7 @@
<el-table-column label="操作" width="100">
<template #default="{ row }">
<span
@click="removePoint(row.index)"
@click="removePoint(row)"
style="cursor: pointer; font-weight: bold; font-size: 18px"
title="点击删除"
></span
@@ -337,11 +337,28 @@
<div v-if="isCellType" style="margin-bottom: 12px">
<!-- 上方输入框和添加按钮 -->
<div style="display: flex; gap: 8px; margin-bottom: 8px">
<el-input
v-model="cellInputValue"
:placeholder="getPlaceholder(selectedType)"
style="flex: 1"
/>
<!-- 单个输入框默认 -->
<el-input
v-if="selectedType !== 'range'"
v-model="cellInputValue"
:placeholder="getPlaceholder(selectedType)"
style="flex: 1"
/>
<!-- 两个输入框用冒号拼接 -->
<template v-else>
<el-input
v-model="rangeStart"
placeholder="开始单元格"
style="flex: 1"
/>
<span>:</span>
<el-input
v-model="rangeEnd"
placeholder="结束单元格"
style="flex: 1"
/>
</template>
<el-button type="primary" @click="addCellValue">确定</el-button>
</div>
@@ -390,23 +407,25 @@ const isCellType = ref(false) // 是否单元格
const cellInputValue = ref('') // 上方输入框值
const cellValues = ref<{ value: string }[]>([]) // 存储所有添加的数据
const selectedRows = ref<{ value: string }[]>([]) // 多选的行
const rangeStart = ref(""); // range 开始
const rangeEnd = ref(""); // range 结束
// 添加到列表(带重复判断)
const addCellValue = () => {
const value = cellInputValue.value.trim()
if (!value) return
// 判断是否重复
const exists = cellValues.value.some(item => item.value === value)
if (exists) {
ElMessage.warning('请勿重复添加')
return
if (selectedType.value === "range") {
if (!rangeStart.value || !rangeEnd.value) return;
cellValues.value.push({
value: rangeStart.value + ":" + rangeEnd.value
});
rangeStart.value = "";
rangeEnd.value = "";
} else {
if (!cellInputValue.value) return;
cellValues.value.push({ value: cellInputValue.value });
cellInputValue.value = "";
}
};
cellValues.value.push({ value })
}
// 表格多选事件
@@ -479,7 +498,7 @@ const formData = ref({
let xlsxPointsInfosList: (typeof xlsxPoints)[] = []
const removePoint = (row) => {
for (let i = 0; i < list.value.length; i++) {
for (let i = 0; i < list.value.length; i++) {
if (row.content == list.value[i].content) {
list.value.splice(i, 1)
}
@@ -615,9 +634,9 @@ const submitXlsxPoints = async () => {
xlsxPointsInfosList = []
console.log(res)
for (let i = 0; i < res.data.length; i++) {
res.data[i].scoreRate='1'
var indexFlag = false
for (let x = 0; x < list.value.length; x++) {
list.value[x].scoreRate='1'
if (res.data[i].content == list.value[x].content) {
// 如果存在相同的数据话 不进入
indexFlag = true