【修改】word,excel页面

This commit is contained in:
huababa1
2025-08-16 21:25:53 +08:00
parent 51799eb43b
commit e44ade01e5
2 changed files with 40 additions and 21 deletions

View File

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

View File

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