【修改】word,excel页面
This commit is contained in:
@@ -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
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user