|
|
|
|
@ -62,7 +62,7 @@ const options = ref({
|
|
|
|
|
// 常量赋值
|
|
|
|
|
const renderTemplate = (str, data) => {
|
|
|
|
|
return str.replace(/#\{(.*?)\}/g, (_, path) => {
|
|
|
|
|
return path.split('.').reduce((o, k) => o?.[k], data) ?? '';
|
|
|
|
|
return path.split('.').reduce((o, k) => o?.[k], data) ?? ' ';
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
// 数组赋值
|
|
|
|
|
@ -119,7 +119,7 @@ const tableTemplate = (table) => {
|
|
|
|
|
Array(length)
|
|
|
|
|
.fill(0)
|
|
|
|
|
.forEach((_, index) => {
|
|
|
|
|
arr.push(fillRowData(obj, index));
|
|
|
|
|
arr.push(fillRowData(JSON.parse(JSON.stringify(obj)), index));
|
|
|
|
|
});
|
|
|
|
|
// arr.push(fillRowData(JSON.parse(JSON.stringify({ ...item, content: row })), requestData[key]));
|
|
|
|
|
} else {
|
|
|
|
|
|