提交 22db19e3 authored 作者: kxjia's avatar kxjia

修改校验

上级 1e9a3c5d
......@@ -51,11 +51,11 @@ const gridOptions = reactive<VxeGridProps<RowVO>>({
{ field: 'itemName', title: '字段名称',width: "15%"},
{ field: 'values', title: '最近5年填报数据',width: "75%",
children: [
{ field: 'value1', title: '第一次',width: "15%"},
{ field: 'value2', title: '第二次',width: "15%"},
{ field: 'value3', title: '第三次',width: "15%"},
{ field: 'value4', title: '第四次',width: "15%"},
{ field: 'value5', title: '第五次',width: "15%"},
{ field: 'value0', title: '第一次',width: "15%"},
{ field: 'value1', title: '第二次',width: "15%"},
{ field: 'value2', title: '第三次',width: "15%"},
{ field: 'value3', title: '第四次',width: "15%"},
{ field: 'value4', title: '第五次',width: "15%"},
],
},
{ field: 'opt', title: '操作' ,width: "10%"},
......@@ -67,19 +67,24 @@ async function onDrawerShow(tplid: number) {
const retData = await findFillHistoryForCheck({
tplid: tplid
});
// 调试:查看数据结构
console.log('原始数据:', retData);
// 处理 values 数据
const processedData = retData.map(item => {
const processedData = retData.map((item, itemIndex) => {
const processedItem = {...item};
// 将 values 数组中的 value 属性提取出来
if (Array.isArray(processedItem.values)) {
processedItem.values.forEach((valueItem, index) => {
// 将每个 valueItem 的 value 属性设置到单独的字段中
processedItem[`value${index}`] = valueItem.value;
// 注意:index从0开始,但字段名应该从1开始
processedItem[`value${index + 1}`] = valueItem.value;
});
}
return processedItem;
});
console.log('处理后的数据:', processedData);
gridOptions.data = processedData;
return false;
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论