|
|
@@ -21,15 +21,16 @@ export interface IJobAndCharacter extends IJobsAndCharacterText {
|
|
|
|
|
|
export const getJobsAndCharacterText = (
|
|
|
jobContents: IJobContent[],
|
|
|
- itemCharacters: IItemCharacter[]
|
|
|
+ itemCharacters: IItemCharacter[],
|
|
|
+ divided = false // 分别对应
|
|
|
): IJobsAndCharacterText => {
|
|
|
- const jobContentText = '';
|
|
|
+ let jobContentText = '';
|
|
|
let itemCharacterText = '';
|
|
|
let onlyJobContentText = '';
|
|
|
let onlyItemCharacterText = '';
|
|
|
jobContents.sort((a, b) => a.seq - b.seq);
|
|
|
itemCharacters.sort((a, b) => a.seq - b.seq);
|
|
|
- const characterTextArray: string[] = ['[项目特征]'];
|
|
|
+ const characterTextArray: string[] = divided ? [] : ['[项目特征]'];
|
|
|
let i = 1;
|
|
|
for (const item of itemCharacters) {
|
|
|
if (item.isChecked) characterTextArray.push(`${i}. ${item.character || ''}: ${item.eigenvalue || ''}`);
|
|
|
@@ -37,14 +38,15 @@ export const getJobsAndCharacterText = (
|
|
|
}
|
|
|
onlyItemCharacterText = characterTextArray.join('\n');
|
|
|
|
|
|
- const jobTextArray = ['[工作内容]'];
|
|
|
+ const jobTextArray = divided ? [] : ['[工作内容]'];
|
|
|
i = 1;
|
|
|
for (const job of jobContents) {
|
|
|
if (job.isChecked) jobTextArray.push(`${i}. ${job.content || ''}`);
|
|
|
i += 1;
|
|
|
}
|
|
|
onlyJobContentText = jobTextArray.join('\n');
|
|
|
- itemCharacterText = `${onlyItemCharacterText}\n${onlyJobContentText}`;
|
|
|
+ jobContentText = divided ? onlyJobContentText : '';
|
|
|
+ itemCharacterText = divided ? onlyItemCharacterText : `${onlyItemCharacterText}\n${onlyJobContentText}`;
|
|
|
return { jobContentText, itemCharacterText, onlyItemCharacterText, onlyJobContentText };
|
|
|
};
|
|
|
|