This commit is contained in:
icssoa
2025-08-22 00:20:59 +08:00
parent 8a8ea1d6c2
commit 4355748a67
4 changed files with 9 additions and 6 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -273,20 +273,23 @@ function setValue(val: Value) {
// 遍历所有列 // 遍历所有列
for (let i = 0; i < props.columnCount; i++) { for (let i = 0; i < props.columnCount; i++) {
// 获取当前列的选项数据
const column = columns.value[i];
// 判断是否超出选中值数组长度 // 判断是否超出选中值数组长度
if (i >= _value.length) { if (i >= _value.length) {
// 添加默认索引0 // 添加默认索引0
_indexes.push(0); _indexes.push(0);
// 添加默认值 // 添加默认值
if (!isNull(columns.value[i][0])) { if (!isNull(column) && column.length > 0 && !isNull(column[0])) {
_value.push(columns.value[i][0].value); _value.push(column[0].value);
} }
} }
// 在范围内 // 在范围内
else { else {
// 查找匹配的选项索引 // 查找匹配的选项索引
let index = columns.value[i].findIndex((e) => e.value == _value[i]); let index = column.findIndex((e) => e.value == _value[i]);
// 索引无效时重置为0 // 索引无效时重置为0
if (index < 0) { if (index < 0) {