Files
jzsj-vue/src/views/pwl/pwlProject/components/data/navigationItems.ts

40 lines
1.3 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { ref } from 'vue';
import { getTableConfig } from './tableCommon';
export function createNavigationItems() {
return Array.from({ length: 11 }, (_, index) => {
const config = getTableConfig(index);
return {
number: getChineseNumber(index + 1),
name: `审计内容${index + 1}`,
title: config?.title || `审计内容${index + 1}`,
description: '点击"AI生成"按钮让AI为您生成该部分内容或直接在下方编辑',
generating: false,
suggestion: '',
mode: 'table',
showFileSelect: true, // 所有项都显示文件选择
data: [],
extraData: [],
currentTableIndex: 0, // 当前选中的表格索引
columns: null,
extraTableTitle: config?.extraTableTitle || null,
extraColumns: config?.extraColumns || [],
tableOptions: config?.options || [],
count: index + 1,
tableType: config?.type || `auditContent${index + 1}`,
content: '',
rows: 8
};
});
}
// 获取中文数字
function getChineseNumber(num) {
const chineseNumbers = ['一', '二', '三', '四', '五', '六', '七', '八', '九', '十', '十一'];
return chineseNumbers[num - 1] || num;
}
export default function useNavigationItems() {
return ref(createNavigationItems());
}